Commit 04f177a9 authored by Gildas Bazin's avatar Gildas Bazin

* modules/mux/mp4.c: added support for amr nb/wb and h263 in 3gp.

parent 5ff8a38b
......@@ -413,7 +413,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
case VLC_FOURCC( 'm', 'j', 'p', 'b' ):
case VLC_FOURCC( 'S', 'V', 'Q', '1' ):
case VLC_FOURCC( 'S', 'V', 'Q', '3' ):
case VLC_FOURCC( 'H', '2', '6', '3' ):
case VLC_FOURCC( 'h', '2', '6', '4' ):
case VLC_FOURCC( 's', 'a', 'm', 'r' ):
case VLC_FOURCC( 's', 'a', 'w', 'b' ):
break;
case VLC_FOURCC( 's', 'u', 'b', 't' ):
msg_Warn( p_mux, "subtitle track added like in .mov (even when creating .mp4)" );
......@@ -882,6 +885,41 @@ static bo_t *GetWaveTag( mp4_stream_t *p_stream )
return wave;
}
static bo_t *GetDamrTag( mp4_stream_t *p_stream )
{
bo_t *damr;
damr = box_new( "damr" );
bo_add_fourcc( damr, "REFC" );
bo_add_8( damr, 0 );
if( p_stream->fmt.i_codec == VLC_FOURCC( 's', 'a', 'm', 'r' ) )
bo_add_16be( damr, 0x81ff ); /* Mode set (all modes for AMR_NB) */
else
bo_add_16be( damr, 0x83ff ); /* Mode set (all modes for AMR_WB) */
bo_add_16be( damr, 0x1 ); /* Mode change period (no restriction) */
box_fix( damr );
return damr;
}
static bo_t *GetD263Tag( mp4_stream_t *p_stream )
{
bo_t *d263;
d263 = box_new( "d263" );
bo_add_fourcc( d263, "VLC " );
bo_add_16be( d263, 0xa );
bo_add_8( d263, 0 );
box_fix( d263 );
return d263;
}
static bo_t *GetAvcCTag( mp4_stream_t *p_stream )
{
bo_t *avcC;
......@@ -1044,6 +1082,12 @@ static bo_t *GetSounBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
b_descr = VLC_TRUE;
break;
case VLC_FOURCC('s','a','m','r'):
case VLC_FOURCC('s','a','w','b'):
memcpy( fcc, (char*)&p_stream->fmt.i_codec, 4 );
b_descr = VLC_TRUE;
break;
case VLC_FOURCC('m','p','g','a'):
if( p_sys->b_mov )
memcpy( fcc, ".mp3", 4 );
......@@ -1110,6 +1154,10 @@ static bo_t *GetSounBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
{
box = GetWaveTag( p_stream );
}
else if( p_stream->fmt.i_codec == VLC_FOURCC('s','a','m','r') )
{
box = GetDamrTag( p_stream );
}
else
{
box = GetESDS( p_stream );
......@@ -1149,6 +1197,10 @@ static bo_t *GetVideBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
memcpy( fcc, "SVQ3", 4 );
break;
case VLC_FOURCC('H','2','6','3'):
memcpy( fcc, "s263", 4 );
break;
case VLC_FOURCC('h','2','6','4'):
memcpy( fcc, "avc1", 4 );
break;
......@@ -1203,6 +1255,15 @@ static bo_t *GetVideBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
}
break;
case VLC_FOURCC('H','2','6','3'):
{
bo_t *d263 = GetD263Tag( p_stream );
box_fix( d263 );
box_gather( vide, d263 );
}
break;
case VLC_FOURCC('S','V','Q','3'):
{
bo_t *esds = GetSVQ3Tag( p_stream );
......
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