Commit 9bf47700 authored by David Flynn's avatar David Flynn Committed by Laurent Aimar

mux/mpeg/ts: Add dirac muxing support

Signed-off-by: default avatarDavid Flynn <davidf@rd.bbc.co.uk>
Signed-off-by: default avatarLaurent Aimar <fenrir@videolan.org>
parent 8fa6777f
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
# include "config.h" # include "config.h"
#endif #endif
#include <limits.h>
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_sout.h> #include <vlc_sout.h>
...@@ -1032,6 +1034,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -1032,6 +1034,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_stream->i_bih_width = p_input->p_fmt->video.i_width; p_stream->i_bih_width = p_input->p_fmt->video.i_width;
p_stream->i_bih_height = p_input->p_fmt->video.i_height; p_stream->i_bih_height = p_input->p_fmt->video.i_height;
break; break;
case VLC_FOURCC( 'd', 'r', 'a', 'c' ):
/* stream_id makes use of stream_id_extension */
p_stream->i_stream_id = (PES_EXTENDED_STREAM_ID << 8) | 0x60;
p_stream->i_stream_type = 0xd1;
break;
default: default:
free( p_stream ); free( p_stream );
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -1538,6 +1545,7 @@ static int Mux( sout_mux_t *p_mux ) ...@@ -1538,6 +1545,7 @@ static int Mux( sout_mux_t *p_mux )
else else
{ {
int i_header_size = 0; int i_header_size = 0;
int i_max_pes_size = 0;
int b_data_alignment = 0; int b_data_alignment = 0;
if( p_input->p_fmt->i_cat == SPU_ES ) if( p_input->p_fmt->i_cat == SPU_ES )
{ {
...@@ -1617,9 +1625,19 @@ static int Mux( sout_mux_t *p_mux ) ...@@ -1617,9 +1625,19 @@ static int Mux( sout_mux_t *p_mux )
p_data->i_pts = p_data->i_dts; p_data->i_pts = p_data->i_dts;
} }
if( p_input->p_fmt->i_codec ==
VLC_FOURCC('d','r','a','c') )
{
b_data_alignment = 1;
/* dirac pes packets should be unbounded in
* length, specify a suitibly large max size */
i_max_pes_size = INT_MAX;
}
EStoPES ( p_mux->p_sout, &p_data, p_data, EStoPES ( p_mux->p_sout, &p_data, p_data,
p_input->p_fmt, p_stream->i_stream_id, p_input->p_fmt, p_stream->i_stream_id,
1, b_data_alignment, i_header_size, 0 ); 1, b_data_alignment, i_header_size,
i_max_pes_size );
BufferChainAppend( &p_stream->chain_pes, p_data ); BufferChainAppend( &p_stream->chain_pes, p_data );
...@@ -2668,6 +2686,13 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c ) ...@@ -2668,6 +2686,13 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c )
/* "registration" descriptor : "AC-3" */ /* "registration" descriptor : "AC-3" */
dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, format ); dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, format );
} }
else if( p_stream->i_codec == VLC_FOURCC('d','r','a','c') )
{
/* Dirac registration descriptor */
uint8_t data[4] = { 'd', 'r', 'a', 'c' };
dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
}
else if( p_stream->i_codec == VLC_FOURCC('d','t','s',' ') ) else if( p_stream->i_codec == VLC_FOURCC('d','t','s',' ') )
{ {
/* DTS registration descriptor (ETSI TS 101 154 Annex F) */ /* DTS registration descriptor (ETSI TS 101 154 Annex F) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment