Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Macros | Enumerations | Functions | Variables
test_stream.c File Reference

Media Stream API Unit Tests. More...

#include "asterisk.h"
#include "asterisk/test.h"
#include "asterisk/module.h"
#include "asterisk/stream.h"
#include "asterisk/format.h"
#include "asterisk/format_cap.h"
#include "asterisk/format_cache.h"
#include "asterisk/channel.h"
#include "asterisk/uuid.h"

Go to the source code of this file.

Data Structures

struct  mock_channel_pvt
 

Macros

#define topology_append_stream(topology, name, type, res, label)
 

Enumerations

enum  CHANNEL_READ_TYPE { CHANNEL_READ, CHANNEL_READ_STREAM }
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
 AST_TEST_DEFINE (stream_create)
 
 AST_TEST_DEFINE (stream_create_no_name)
 
 AST_TEST_DEFINE (stream_set_type)
 
 AST_TEST_DEFINE (stream_set_formats)
 
 AST_TEST_DEFINE (stream_set_state)
 
 AST_TEST_DEFINE (stream_metadata)
 
 AST_TEST_DEFINE (stream_topology_create)
 
 AST_TEST_DEFINE (stream_topology_clone)
 
 AST_TEST_DEFINE (stream_topology_append_stream)
 
 AST_TEST_DEFINE (stream_topology_set_stream)
 
 AST_TEST_DEFINE (stream_topology_del_stream)
 
 AST_TEST_DEFINE (stream_topology_create_from_format_cap)
 
 AST_TEST_DEFINE (stream_topology_get_first_stream_by_type)
 
 AST_TEST_DEFINE (stream_topology_create_from_channel_nativeformats)
 
 AST_TEST_DEFINE (stream_topology_channel_set)
 
 AST_TEST_DEFINE (stream_write_non_multistream)
 
 AST_TEST_DEFINE (stream_write_multistream)
 
 AST_TEST_DEFINE (stream_read_non_multistream)
 
 AST_TEST_DEFINE (stream_read_multistream)
 
 AST_TEST_DEFINE (stream_topology_change_request_from_application_non_multistream)
 
 AST_TEST_DEFINE (stream_topology_change_request_from_channel_non_multistream)
 
 AST_TEST_DEFINE (stream_topology_change_request_from_application)
 
 AST_TEST_DEFINE (stream_topology_change_request_from_channel)
 
 AST_TEST_DEFINE (format_cap_from_stream_topology)
 
 AST_TEST_DEFINE (stream_topology_map_create)
 
static int check_stream_positions (struct ast_test *test, const struct ast_stream_topology *topology)
 
static int load_module (void)
 
static int load_stream_readqueue (struct ast_channel *chan, int frames)
 
static struct ast_channelmake_channel (struct ast_test *test, int streams, struct ast_channel_tech *tech)
 
static int mock_channel_hangup (struct ast_channel *chan)
 
static int mock_channel_indicate (struct ast_channel *chan, int condition, const void *data, size_t datalen)
 
static struct ast_framemock_channel_read (struct ast_channel *chan)
 
static int mock_channel_write (struct ast_channel *chan, struct ast_frame *fr)
 
static int mock_channel_write_stream (struct ast_channel *chan, int stream_num, struct ast_frame *fr)
 
static struct ast_frameread_from_chan (enum CHANNEL_READ_TYPE rt, struct ast_channel *chan)
 
static enum ast_test_result_state read_test (struct ast_test *test, struct ast_channel_tech *tech, enum CHANNEL_READ_TYPE rt, int streams, int frames, int frames_per_read, int expected_nulls)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Media Stream API test module" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static const struct ast_channel_tech mock_channel_old_write_tech
 
static const struct ast_channel_tech mock_channel_tech
 
static const struct ast_channel_tech mock_channel_write_stream_tech
 
static const struct ast_channel_tech mock_stream_channel_tech
 

Detailed Description

Media Stream API Unit Tests.

Author
Joshua Colp jcolp.nosp@m.@dig.nosp@m.ium.c.nosp@m.om

Definition in file test_stream.c.

Variable Documentation

const struct ast_channel_tech mock_channel_old_write_tech
static
Initial value:
= {
.write = mock_channel_write,
.write_video = mock_channel_write,
.hangup = mock_channel_hangup,
}

Definition at line 1239 of file test_stream.c.

const struct ast_channel_tech mock_channel_tech
static
Initial value:
= {
}

Definition at line 988 of file test_stream.c.

const struct ast_channel_tech mock_stream_channel_tech
static
Initial value:
= {
.read_stream = mock_channel_read,
.write_stream = mock_channel_write_stream,
}

Definition at line 1177 of file test_stream.c.