/*****************************************************************************
* asf.c: asf muxer module for vlc
*****************************************************************************
- * Copyright (C) 2003-2004 VideoLAN
+ * Copyright (C) 2003-2004, 2006 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
typedef GUID guid_t;
#define MAX_ASF_TRACKS 128
-#define ASF_DATA_PACKET_SIZE 4096
+#define ASF_DATA_PACKET_SIZE 4096 // deprecated -- added sout-asf-packet-size
/*****************************************************************************
* Module descriptor
#define SOUT_CFG_PREFIX "sout-asf-"
#define TITLE_TEXT N_("Title")
-#define TITLE_LONGTEXT N_("Allows you to define the title that will be put " \
- "in ASF comments.")
+#define TITLE_LONGTEXT N_("Title to put in ASF comments." )
#define AUTHOR_TEXT N_("Author")
-#define AUTHOR_LONGTEXT N_("Allows you to define the author that will be put "\
- "in ASF comments.")
+#define AUTHOR_LONGTEXT N_("Author to put in ASF comments." )
#define COPYRIGHT_TEXT N_("Copyright")
-#define COPYRIGHT_LONGTEXT N_("Allows you to define the copyright string " \
- "that will be put in ASF comments.")
+#define COPYRIGHT_LONGTEXT N_("Copyright string to put in ASF comments." )
#define COMMENT_TEXT N_("Comment")
-#define COMMENT_LONGTEXT N_("Allows you to define the comment that will be " \
- "put in ASF comments.")
+#define COMMENT_LONGTEXT N_("Comment to put in ASF comments." )
#define RATING_TEXT N_("Rating")
-#define RATING_LONGTEXT N_("Allows you to define the \"rating\" that will " \
- "be put in ASF comments.")
+#define RATING_LONGTEXT N_("\"Rating\" to put in ASF comments." )
+#define PACKETSIZE_TEXT N_("Packet Size")
+#define PACKETSIZE_LONGTEXT N_("ASF packet size -- default is 4096 bytes")
vlc_module_begin();
set_description( _("ASF muxer") );
COMMENT_LONGTEXT, VLC_TRUE );
add_string( SOUT_CFG_PREFIX "rating", "", NULL, RATING_TEXT,
RATING_LONGTEXT, VLC_TRUE );
+ add_integer( "sout-asf-packet-size", 4096, NULL, PACKETSIZE_TEXT, PACKETSIZE_LONGTEXT, VLC_TRUE );
+
vlc_module_end();
/*****************************************************************************
vlc_value_t val;
int i;
- msg_Dbg( p_mux, "Asf muxer opened" );
- sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
+ msg_Dbg( p_mux, "asf muxer opened" );
+ config_ChainParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
p_mux->pf_control = Control;
p_mux->pf_addstream = AddStream;
p_sys->b_write_header = VLC_TRUE;
p_sys->i_track = 0;
- p_sys->i_packet_size = ASF_DATA_PACKET_SIZE;
+ p_sys->i_packet_size = config_GetInt( p_mux, "sout-asf-packet-size" );
+ msg_Dbg( p_mux, "Packet size %d", p_sys->i_packet_size);
p_sys->i_packet_count= 0;
/* Generate a random fid */
var_Get( p_mux, SOUT_CFG_PREFIX "rating", &val );
p_sys->psz_rating = val.psz_string;
- msg_Dbg( p_mux, "meta data: title='%s' author='%s' copyright='%s' "
- "comment='%s' rating='%s'",
+ msg_Dbg( p_mux, "meta data: title='%s', author='%s', copyright='%s', "
+ "comment='%s', rating='%s'",
p_sys->psz_title, p_sys->psz_author, p_sys->psz_copyright,
p_sys->psz_comment, p_sys->psz_rating );
msg_Dbg( p_mux, "adding input" );
if( p_sys->i_track >= MAX_ASF_TRACKS )
{
- msg_Dbg( p_mux, "cannot add this track (too much track)" );
+ msg_Dbg( p_mux, "cannot add this track (too much tracks)" );
return VLC_EGENERIC;
}
case VLC_FOURCC( 'a', '5', '2', ' ' ):
tk->i_tag = WAVE_FORMAT_A52;
tk->psz_name = "A/52";
+ i_bitspersample = 0;
+ break;
+ case VLC_FOURCC( 'm', 'p', '4', 'a' ):
+ tk->i_tag = WAVE_FORMAT_AAC;
+ tk->psz_name = "MPEG-4 Audio";
+ i_bitspersample = 0;
break;
case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
#if 1
tk->psz_name = "MPEG Audio Layer 3";
tk->i_tag = WAVE_FORMAT_MPEGLAYER3;
+ i_bitspersample = 0;
i_blockalign = 1;
i_extra = 12;
break;
#else
tk->psz_name = "MPEG Audio Layer 1/2";
tk->i_tag = WAVE_FORMAT_MPEG;
+ i_bitspersample = 0;
i_blockalign = 1;
i_extra = 22;
break;
}
else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','M','V','1') )
{
- tk->psz_name = "Windows Media Video 1";
+ tk->psz_name = "Windows Media Video 7";
tk->i_fourcc = VLC_FOURCC( 'W', 'M', 'V', '1' );
}
else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','M','V','2') )
{
- tk->psz_name = "Windows Media Video 2";
+ tk->psz_name = "Windows Media Video 8";
tk->i_fourcc = VLC_FOURCC( 'W', 'M', 'V', '2' );
}
else if( p_input->p_fmt->i_codec == VLC_FOURCC('W','M','V','3') )
{
- tk->psz_name = "Windows Media Video 3";
+ tk->psz_name = "Windows Media Video 9";
tk->i_fourcc = VLC_FOURCC( 'W', 'M', 'V', '3' );
}
+ else if( p_input->p_fmt->i_codec == VLC_FOURCC('h','2','6','4') )
+ {
+ tk->psz_name = "H.264/MPEG-4 AVC";
+ tk->i_fourcc = VLC_FOURCC('h','2','6','4');
+ }
else
{
tk->psz_name = _("Unknown Video");
{0x8cabdca1, 0xa947, 0x11cf, {0x8e, 0xe4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}};
static const guid_t asf_object_stream_properties_guid =
{0xB7DC0791, 0xA9B7, 0x11CF, {0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}};
-static const guid_t asf_object_header_extention_guid =
+static const guid_t asf_object_header_extension_guid =
{0x5FBF03B5, 0xA92E, 0x11CF, {0x8E, 0xE3, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}};
static const guid_t asf_object_stream_type_audio =
{0xF8699E40, 0x5B4D, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}};
bo_addle_u32( &bo, p_sys->i_packet_size ); /* packet size max */
bo_addle_u32( &bo, p_sys->i_bitrate ); /* maxbitrate */
- /* header extention */
+ /* header extension */
if( i_header_ext_size )
{
- bo_add_guid ( &bo, &asf_object_header_extention_guid );
+ bo_add_guid ( &bo, &asf_object_header_extension_guid );
bo_addle_u64( &bo, i_header_ext_size );
bo_add_guid ( &bo, &asf_guid_reserved_1 );
bo_addle_u16( &bo, 6 );
if( i_cm_size )
{
int64_t i_num, i_den;
- int i_dst_num, i_dst_den;
+ unsigned int i_dst_num, i_dst_den;
for( i = 0; i < p_sys->i_track; i++ )
if( p_sys->track[i].i_cat == VIDEO_ES ) break;
i_num = p_sys->track[i].fmt.video.i_aspect *
(int64_t)p_sys->track[i].fmt.video.i_height;
i_den = VOUT_ASPECT_FACTOR * p_sys->track[i].fmt.video.i_width;
- vlc_reduce( &i_dst_num, &i_dst_den, i_num, i_den, 0 );
+ vlc_ureduce( &i_dst_num, &i_dst_den, i_num, i_den, 0 );
msg_Dbg( p_mux, "pixel aspect-ratio: %i/%i", i_dst_num, i_dst_den );