Commit 06e1acc1 authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/mp4/*, modules/mux/mp4.c: add support for yv12 and yuy2.

parent 4ccb8b80
...@@ -2344,6 +2344,9 @@ static struct ...@@ -2344,6 +2344,9 @@ static struct
{ FOURCC_jpeg, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide }, { FOURCC_jpeg, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ FOURCC_avc1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide }, { FOURCC_avc1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ FOURCC_yv12, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ FOURCC_yuv2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ FOURCC_mp4s, MP4_ReadBox_sample_mp4s, MP4_FreeBox_Common }, { FOURCC_mp4s, MP4_ReadBox_sample_mp4s, MP4_FreeBox_Common },
/* XXX there is 2 box where we could find this entry stbl and tref*/ /* XXX there is 2 box where we could find this entry stbl and tref*/
......
...@@ -155,6 +155,8 @@ ...@@ -155,6 +155,8 @@
#define FOURCC_jpeg VLC_FOURCC( 'j', 'p', 'e', 'g' ) #define FOURCC_jpeg VLC_FOURCC( 'j', 'p', 'e', 'g' )
#define FOURCC_yv12 VLC_FOURCC( 'y', 'v', '1', '2' )
#define FOURCC_yuv2 VLC_FOURCC( 'y', 'u', 'v', '2' )
#define FOURCC_rmra VLC_FOURCC( 'r', 'm', 'r', 'a' ) #define FOURCC_rmra VLC_FOURCC( 'r', 'm', 'r', 'a' )
#define FOURCC_rmda VLC_FOURCC( 'r', 'm', 'd', 'a' ) #define FOURCC_rmda VLC_FOURCC( 'r', 'm', 'd', 'a' )
......
...@@ -1298,6 +1298,13 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track, ...@@ -1298,6 +1298,13 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
p_track->fmt.subs.psz_encoding = strdup( "UTF-8" ); p_track->fmt.subs.psz_encoding = strdup( "UTF-8" );
break; break;
case VLC_FOURCC('y','v','1','2'):
p_track->fmt.i_codec = VLC_FOURCC('Y','V','1','2');
break;
case VLC_FOURCC('y','u','v','2'):
p_track->fmt.i_codec = VLC_FOURCC('Y','U','Y','2');
break;
default: default:
p_track->fmt.i_codec = p_sample->i_type; p_track->fmt.i_codec = p_sample->i_type;
break; break;
......
...@@ -406,6 +406,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -406,6 +406,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
case VLC_FOURCC( 'h', '2', '6', '4' ): case VLC_FOURCC( 'h', '2', '6', '4' ):
case VLC_FOURCC( 's', 'a', 'm', 'r' ): case VLC_FOURCC( 's', 'a', 'm', 'r' ):
case VLC_FOURCC( 's', 'a', 'w', 'b' ): case VLC_FOURCC( 's', 'a', 'w', 'b' ):
case VLC_FOURCC( 'Y', 'V', '1', '2' ):
case VLC_FOURCC( 'Y', 'U', 'Y', '2' ):
break; break;
case VLC_FOURCC( 's', 'u', 'b', 't' ): case VLC_FOURCC( 's', 'u', 'b', 't' ):
msg_Warn( p_mux, "subtitle track added like in .mov (even when creating .mp4)" ); msg_Warn( p_mux, "subtitle track added like in .mov (even when creating .mp4)" );
...@@ -1214,6 +1216,14 @@ static bo_t *GetVideBox( sout_mux_t *p_mux, mp4_stream_t *p_stream ) ...@@ -1214,6 +1216,14 @@ static bo_t *GetVideBox( sout_mux_t *p_mux, mp4_stream_t *p_stream )
memcpy( fcc, "avc1", 4 ); memcpy( fcc, "avc1", 4 );
break; break;
case VLC_FOURCC('Y','V','1','2'):
memcpy( fcc, "yv12", 4 );
break;
case VLC_FOURCC('Y','U','Y','2'):
memcpy( fcc, "yuy2", 4 );
break;
default: default:
memcpy( fcc, (char*)&p_stream->fmt.i_codec, 4 ); memcpy( fcc, (char*)&p_stream->fmt.i_codec, 4 );
break; break;
......
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