| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
#include "../pyunit.h" |
|---|
| 23 |
#ifdef HAVE_CONFIG_H |
|---|
| 24 |
# include "config.h" |
|---|
| 25 |
#endif |
|---|
| 26 |
|
|---|
| 27 |
#include <vlc/vlc.h> |
|---|
| 28 |
#include <vlc_streaming.h> |
|---|
| 29 |
|
|---|
| 30 |
#define STDCHAIN1 "#std{access=udp,url=12.42.12.42,mux=ts}" |
|---|
| 31 |
|
|---|
| 32 |
static void BuildStdChain1( sout_chain_t *p_chain ) |
|---|
| 33 |
{ |
|---|
| 34 |
streaming_ChainAddStd( p_chain, "udp", "ts", "12.42.12.42" ); |
|---|
| 35 |
} |
|---|
| 36 |
|
|---|
| 37 |
#define TRACHAIN1 "#transcode{vcodec=mpgv,vb=1024,scale=1.0,acodec=mp3,ab=128,channels=2}:std{mux=mp4,access=file,url=/dev/null}" |
|---|
| 38 |
static void BuildTranscodeChain1( sout_chain_t *p_chain ) |
|---|
| 39 |
{ |
|---|
| 40 |
streaming_ChainAddTranscode( p_chain, "mpgv", "mp3", NULL, 1024, 1.0, |
|---|
| 41 |
128, 2, NULL ); |
|---|
| 42 |
streaming_ChainAddStd( p_chain, "file", "mp4", "/dev/null" ); |
|---|
| 43 |
} |
|---|
| 44 |
|
|---|
| 45 |
static void BuildInvalid1( sout_chain_t *p_chain ) |
|---|
| 46 |
{ |
|---|
| 47 |
streaming_ChainAddStd( p_chain, "file", "mp4", "/dev/null" ); |
|---|
| 48 |
streaming_ChainAddStd( p_chain, "file", "mp4", "/dev/null" ); |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
PyObject *chains_test( PyObject *self, PyObject *args ) |
|---|
| 52 |
{ |
|---|
| 53 |
sout_chain_t *p_chain = streaming_ChainNew(); |
|---|
| 54 |
sout_duplicate_t *p_dup; |
|---|
| 55 |
ASSERT( p_chain->i_modules == 0, "unclean chain" ); |
|---|
| 56 |
ASSERT( p_chain->i_options == 0, "unclean chain" ); |
|---|
| 57 |
ASSERT( p_chain->pp_modules == NULL, "unclean chain" ); |
|---|
| 58 |
ASSERT( p_chain->ppsz_options == NULL, "unclean chain" ); |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
p_dup = streaming_ChainAddDup( p_chain ); |
|---|
| 62 |
ASSERT( p_chain->i_modules == 1, "not 1 module" ); |
|---|
| 63 |
ASSERT( p_dup->i_children == 0, "dup has children" ); |
|---|
| 64 |
streaming_DupAddChild( p_dup ); |
|---|
| 65 |
ASSERT( p_dup->i_children == 1, "not 1 child" ); |
|---|
| 66 |
ASSERT( p_dup->pp_children[0]->i_modules == 0, "unclean child chain"); |
|---|
| 67 |
streaming_DupAddChild( p_dup ); |
|---|
| 68 |
ASSERT( p_dup->i_children == 2, "not 2 children" ); |
|---|
| 69 |
|
|---|
| 70 |
Py_INCREF( Py_None ); |
|---|
| 71 |
return Py_None; |
|---|
| 72 |
} |
|---|
| 73 |
|
|---|
| 74 |
PyObject *gui_chains_test( PyObject *self, PyObject *args ) |
|---|
| 75 |
{ |
|---|
| 76 |
Py_INCREF( Py_None); |
|---|
| 77 |
return Py_None; |
|---|
| 78 |
} |
|---|
| 79 |
|
|---|
| 80 |
PyObject *psz_chains_test( PyObject *self, PyObject *args ) |
|---|
| 81 |
{ |
|---|
| 82 |
sout_chain_t *p_chain = streaming_ChainNew(); |
|---|
| 83 |
sout_module_t *p_module; |
|---|
| 84 |
char *psz_output; |
|---|
| 85 |
printf( "\n" ); |
|---|
| 86 |
|
|---|
| 87 |
BuildStdChain1( p_chain ); |
|---|
| 88 |
psz_output = streaming_ChainToPsz( p_chain ); |
|---|
| 89 |
printf( "STD1: %s\n", psz_output ); |
|---|
| 90 |
ASSERT( !strcmp( psz_output, STDCHAIN1 ), "wrong output for STD1" ) |
|---|
| 91 |
ASSERT( p_chain->i_modules == 1, "wrong number of modules" ); |
|---|
| 92 |
p_module = p_chain->pp_modules[0]; |
|---|
| 93 |
ASSERT( p_module->i_type == SOUT_MOD_STD, "wrong type of module" ); |
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
Py_INCREF( Py_None); |
|---|
| 97 |
return Py_None; |
|---|
| 98 |
} |
|---|