*****************************************************************************/
static int Control ( sout_mux_t *, int, va_list );
static int AddStream( sout_mux_t *, sout_input_t * );
-static int DelStream( sout_mux_t *, sout_input_t * );
+static void DelStream( sout_mux_t *, sout_input_t * );
static int Mux ( sout_mux_t * );
static int MuxBlock ( sout_mux_t *, sout_input_t * );
mtime_t i_length;
int i_packet_no;
int i_serial_no;
- int i_keyframe_granule_shift; /* Theora only */
+ int i_keyframe_granule_shift; /* Theora and Daala only */
int i_last_keyframe; /* dirac and theora */
int i_num_frames; /* Theora only */
uint64_t u_last_granulepos; /* Used for correct EOS page */
!p_input->p_fmt->video.i_frame_rate_base )
{
msg_Warn( p_mux, "Missing frame rate, assuming 25fps" );
- p_input->p_fmt->video.i_frame_rate = 25;
- p_input->p_fmt->video.i_frame_rate_base = 1;
+ assert(p_input->p_fmt == &p_input->fmt);
+ p_input->fmt.video.i_frame_rate = 25;
+ p_input->fmt.video.i_frame_rate_base = 1;
}
switch( p_stream->i_fourcc )
msg_Dbg( p_mux, "theora stream" );
break;
+ case VLC_CODEC_DAALA:
+ msg_Dbg( p_mux, "daala stream" );
+ break;
+
case VLC_CODEC_VP8:
msg_Dbg( p_mux, "VP8 stream" );
break;
/*****************************************************************************
* DelStream: Delete an elementary stream from the muxed stream
*****************************************************************************/
-static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
+static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
ogg_stream_t *p_stream = (ogg_stream_t*)p_input->p_sys;
}
p_input->p_sys = NULL;
-
- return 0;
}
/*****************************************************************************
case VLC_CODEC_THEORA:
psz_value = "video/theora";
break;
+ case VLC_CODEC_DAALA:
+ psz_value = "video/daala";
+ break;
case VLC_CODEC_SPEEX:
psz_value = "audio/speex";
break;
break;
default:
psz_value = "application/octet-stream";
- msg_Warn( p_mux, "Unkown fourcc for stream %s, setting Content-Type to %s",
+ msg_Warn( p_mux, "Unknown fourcc for stream %s, setting Content-Type to %s",
vlc_fourcc_GetDescription( p_stream->i_cat, p_stream->i_fourcc ),
psz_value );
}
if ( p_input->p_fmt->p_extra )
SetDWLE( &(*pp_buffer)[44], xiph_CountHeaders( p_input->p_fmt->p_extra, p_input->p_fmt->i_extra ) );
- psz_header = *pp_buffer + FISBONE_BASE_SIZE;
- memcpy( psz_header, headers.psz_content_type, strlen( headers.psz_content_type ) );
- psz_header += strlen( headers.psz_content_type );
- if ( headers.psz_role )
- memcpy( psz_header, headers.psz_role, strlen( headers.psz_role ) );
-
+ if ( headers.i_size > 0 )
+ {
+ psz_header = *pp_buffer + FISBONE_BASE_SIZE;
+ memcpy( psz_header, headers.psz_content_type, strlen( headers.psz_content_type ) );
+ psz_header += strlen( headers.psz_content_type );
+ if ( headers.psz_role )
+ memcpy( psz_header, headers.psz_role, strlen( headers.psz_role ) );
+ }
*pi_size = FISBONE_BASE_SIZE + headers.i_size;
free( headers.psz_content_type );
/* extra header */
if( p_oggds_header->i_size > 0 )
{
- memcpy( &p_buffer[index], p_oggds_header + sizeof(*p_oggds_header), p_oggds_header->i_size );
+ memcpy( &p_buffer[index], (uint8_t *) p_oggds_header + sizeof(*p_oggds_header), p_oggds_header->i_size );
index += p_oggds_header->i_size;
}
sout_input_t *p_input = p_mux->pp_inputs[i];
p_stream = (ogg_stream_t*)p_input->p_sys;
- bool video = ( p_stream->i_fourcc == VLC_CODEC_THEORA || p_stream->i_fourcc == VLC_CODEC_DIRAC );
+ bool video = ( p_stream->i_fourcc == VLC_CODEC_THEORA ||
+ p_stream->i_fourcc == VLC_CODEC_DIRAC ||
+ p_stream->i_fourcc == VLC_CODEC_DAALA );
if( ( ( pass == 0 && !video ) || ( pass == 1 && video ) ) )
continue;
if( p_stream->i_fourcc == VLC_CODEC_VORBIS ||
p_stream->i_fourcc == VLC_CODEC_SPEEX ||
p_stream->i_fourcc == VLC_CODEC_OPUS ||
- p_stream->i_fourcc == VLC_CODEC_THEORA )
+ p_stream->i_fourcc == VLC_CODEC_THEORA ||
+ p_stream->i_fourcc == VLC_CODEC_DAALA )
{
- /* First packet in order: vorbis/speex/theora info */
+ /* First packet in order: vorbis/speex/opus/theora/daala info */
unsigned pi_size[XIPH_MAX_HEADER_COUNT];
void *pp_data[XIPH_MAX_HEADER_COUNT];
unsigned i_count;
ogg_stream_packetin( &p_stream->os, &op );
p_og = OggStreamFlush( p_mux, &p_stream->os, 0 );
- /* Get keyframe_granule_shift for theora granulepos calculation */
- if( p_stream->i_fourcc == VLC_CODEC_THEORA )
+ /* Get keyframe_granule_shift for theora or daala granulepos calculation */
+ if( p_stream->i_fourcc == VLC_CODEC_THEORA ||
+ p_stream->i_fourcc == VLC_CODEC_DAALA )
{
p_stream->i_keyframe_granule_shift =
( (op.packet[40] & 0x03) << 3 ) | ( (op.packet[41] & 0xe0) >> 5 );
if( p_stream->i_fourcc == VLC_CODEC_VORBIS ||
p_stream->i_fourcc == VLC_CODEC_SPEEX ||
p_stream->i_fourcc == VLC_CODEC_OPUS ||
- p_stream->i_fourcc == VLC_CODEC_THEORA )
+ p_stream->i_fourcc == VLC_CODEC_THEORA ||
+ p_stream->i_fourcc == VLC_CODEC_DAALA )
{
unsigned pi_size[XIPH_MAX_HEADER_COUNT];
void *pp_data[XIPH_MAX_HEADER_COUNT];
p_stream->i_fourcc != VLC_CODEC_SPEEX &&
p_stream->i_fourcc != VLC_CODEC_OPUS &&
p_stream->i_fourcc != VLC_CODEC_THEORA &&
+ p_stream->i_fourcc != VLC_CODEC_DAALA &&
p_stream->i_fourcc != VLC_CODEC_VP8 &&
p_stream->i_fourcc != VLC_CODEC_DIRAC )
{
}
else if( p_stream->i_cat == VIDEO_ES )
{
- if( p_stream->i_fourcc == VLC_CODEC_THEORA )
+ if( p_stream->i_fourcc == VLC_CODEC_THEORA ||
+ p_stream->i_fourcc == VLC_CODEC_DAALA )
{
p_stream->i_num_frames++;
if( p_data->i_flags & BLOCK_FLAG_TYPE_I )