]> git.sesse.net Git - vlc/commitdiff
* modules/mux/mp4.c: added a 3gp mode which writes a 3gp ftyp header.
authorGildas Bazin <gbazin@videolan.org>
Fri, 29 Oct 2004 09:19:38 +0000 (09:19 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 29 Oct 2004 09:19:38 +0000 (09:19 +0000)
modules/mux/mp4.c

index cd02754d6f9e4b05c1f38c63300362e1225033b4..4a615bb65268c725b0a41d7b3d4ea48cce2496a9 100644 (file)
@@ -60,6 +60,7 @@ vlc_module_begin();
     set_capability( "sout mux", 5 );
     add_shortcut( "mp4" );
     add_shortcut( "mov" );
+    add_shortcut( "3gp" );
     set_callbacks( Open, Close );
 vlc_module_end();
 
@@ -128,6 +129,7 @@ typedef struct
 struct sout_mux_sys_t
 {
     vlc_bool_t b_mov;
+    vlc_bool_t b_3gp;
     vlc_bool_t b_64_ext;
     vlc_bool_t b_fast_start;
 
@@ -200,6 +202,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->pp_streams   = NULL;
     p_sys->i_mdat_pos   = 0;
     p_sys->b_mov        = p_mux->psz_mux && !strcmp( p_mux->psz_mux, "mov" );
+    p_sys->b_3gp        = p_mux->psz_mux && !strcmp( p_mux->psz_mux, "3gp" );
     p_sys->i_dts_start  = 0;
 
 
@@ -207,9 +210,11 @@ static int Open( vlc_object_t *p_this )
     {
         /* Now add ftyp header */
         box = box_new( "ftyp" );
-        bo_add_fourcc( box, "isom" );
+        if( p_sys->b_3gp ) bo_add_fourcc( box, "3gp4" );
+        else bo_add_fourcc( box, "isom" );
         bo_add_32be  ( box, 0 );
-        bo_add_fourcc( box, "mp41" );
+        if( p_sys->b_3gp ) bo_add_fourcc( box, "3gp4" );
+        else bo_add_fourcc( box, "mp41" );
         box_fix( box );
 
         p_sys->i_pos += box->i_buffer;