Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
bfeea8d6
Commit
bfeea8d6
authored
Nov 21, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all: remove sout_format_t and use es_format_t instead.
parent
151a7cdf
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
315 additions
and
346 deletions
+315
-346
include/stream_output.h
include/stream_output.h
+8
-26
include/vlc_common.h
include/vlc_common.h
+7
-4
include/vlc_es.h
include/vlc_es.h
+5
-5
modules/mux/asf.c
modules/mux/asf.c
+32
-32
modules/mux/avi.c
modules/mux/avi.c
+18
-18
modules/mux/mp4.c
modules/mux/mp4.c
+33
-33
modules/mux/mpeg/ps.c
modules/mux/mpeg/ps.c
+4
-4
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+12
-12
modules/mux/ogg.c
modules/mux/ogg.c
+11
-11
modules/packetizer/mpegvideo.c
modules/packetizer/mpegvideo.c
+11
-11
modules/stream_out/display.c
modules/stream_out/display.c
+19
-19
modules/stream_out/dummy.c
modules/stream_out/dummy.c
+3
-3
modules/stream_out/duplicate.c
modules/stream_out/duplicate.c
+3
-3
modules/stream_out/es.c
modules/stream_out/es.c
+6
-6
modules/stream_out/gather.c
modules/stream_out/gather.c
+13
-13
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+20
-20
modules/stream_out/standard.c
modules/stream_out/standard.c
+3
-3
modules/stream_out/transcode.c
modules/stream_out/transcode.c
+90
-90
modules/stream_out/transrate/transrate.c
modules/stream_out/transrate/transrate.c
+6
-6
src/input/input_dec.c
src/input/input_dec.c
+5
-21
src/stream_output/stream_output.c
src/stream_output/stream_output.c
+6
-6
No files found.
include/stream_output.h
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* stream_output.h : stream output module
* stream_output.h : stream output module
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* Copyright (C) 2002 VideoLAN
* $Id: stream_output.h,v 1.1
5 2003/11/07 16:53:54 massiot
Exp $
* $Id: stream_output.h,v 1.1
6 2003/11/21 15:32:08 fenrir
Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
* sout_instance_t: stream output thread descriptor
* sout_instance_t: stream output thread descriptor
*****************************************************************************/
*****************************************************************************/
#include "vlc_es.h"
/*
/*
* i_allocated_size: size of allocated buffer
* i_allocated_size: size of allocated buffer
* p_allocated_buffer: where data has been allocated
* p_allocated_buffer: where data has been allocated
...
@@ -65,26 +67,6 @@ struct sout_buffer_t
...
@@ -65,26 +67,6 @@ struct sout_buffer_t
struct
sout_buffer_t
*
p_next
;
struct
sout_buffer_t
*
p_next
;
};
};
struct
sout_format_t
{
int
i_cat
;
vlc_fourcc_t
i_fourcc
;
/* audio */
int
i_sample_rate
;
int
i_channels
;
int
i_block_align
;
/* video */
int
i_width
;
int
i_height
;
int
i_bitrate
;
int
i_extra_data
;
uint8_t
*
p_extra_data
;
};
struct
sout_fifo_t
struct
sout_fifo_t
{
{
vlc_mutex_t
lock
;
/* fifo data lock */
vlc_mutex_t
lock
;
/* fifo data lock */
...
@@ -102,7 +84,7 @@ struct sout_input_t
...
@@ -102,7 +84,7 @@ struct sout_input_t
{
{
sout_instance_t
*
p_sout
;
sout_instance_t
*
p_sout
;
sout_format_t
*
p_fmt
;
es_format_t
*
p_fmt
;
sout_fifo_t
*
p_fifo
;
sout_fifo_t
*
p_fifo
;
void
*
p_sys
;
void
*
p_sys
;
...
@@ -114,7 +96,7 @@ struct sout_packetizer_input_t
...
@@ -114,7 +96,7 @@ struct sout_packetizer_input_t
sout_instance_t
*
p_sout
;
sout_instance_t
*
p_sout
;
sout_format_t
*
p_fmt
;
es_format_t
*
p_fmt
;
sout_stream_id_t
*
id
;
sout_stream_id_t
*
id
;
};
};
...
@@ -225,7 +207,7 @@ struct sout_stream_t
...
@@ -225,7 +207,7 @@ struct sout_stream_t
char
*
psz_next
;
char
*
psz_next
;
/* add, remove a stream */
/* add, remove a stream */
sout_stream_id_t
*
(
*
pf_add
)
(
sout_stream_t
*
,
sout
_format_t
*
);
sout_stream_id_t
*
(
*
pf_add
)
(
sout_stream_t
*
,
es
_format_t
*
);
int
(
*
pf_del
)
(
sout_stream_t
*
,
sout_stream_id_t
*
);
int
(
*
pf_del
)
(
sout_stream_t
*
,
sout_stream_id_t
*
);
/* manage a packet */
/* manage a packet */
...
@@ -296,7 +278,7 @@ VLC_EXPORT( sout_buffer_t *, sout_FifoShow, ( sout_fifo_t * ) );
...
@@ -296,7 +278,7 @@ VLC_EXPORT( sout_buffer_t *, sout_FifoShow, ( sout_fifo_t * ) );
#define sout_InputNew( a, b ) __sout_InputNew( VLC_OBJECT(a), b )
#define sout_InputNew( a, b ) __sout_InputNew( VLC_OBJECT(a), b )
VLC_EXPORT
(
sout_packetizer_input_t
*
,
__sout_InputNew
,
(
vlc_object_t
*
,
sout
_format_t
*
)
);
VLC_EXPORT
(
sout_packetizer_input_t
*
,
__sout_InputNew
,
(
vlc_object_t
*
,
es
_format_t
*
)
);
VLC_EXPORT
(
int
,
sout_InputDelete
,
(
sout_packetizer_input_t
*
)
);
VLC_EXPORT
(
int
,
sout_InputDelete
,
(
sout_packetizer_input_t
*
)
);
VLC_EXPORT
(
int
,
sout_InputSendBuffer
,
(
sout_packetizer_input_t
*
,
sout_buffer_t
*
)
);
VLC_EXPORT
(
int
,
sout_InputSendBuffer
,
(
sout_packetizer_input_t
*
,
sout_buffer_t
*
)
);
...
@@ -313,7 +295,7 @@ VLC_EXPORT( int, sout_AccessOutSeek, ( sout_access_out_t *, of
...
@@ -313,7 +295,7 @@ VLC_EXPORT( int, sout_AccessOutSeek, ( sout_access_out_t *, of
VLC_EXPORT
(
int
,
sout_AccessOutWrite
,
(
sout_access_out_t
*
,
sout_buffer_t
*
)
);
VLC_EXPORT
(
int
,
sout_AccessOutWrite
,
(
sout_access_out_t
*
,
sout_buffer_t
*
)
);
VLC_EXPORT
(
sout_mux_t
*
,
sout_MuxNew
,
(
sout_instance_t
*
,
char
*
,
sout_access_out_t
*
)
);
VLC_EXPORT
(
sout_mux_t
*
,
sout_MuxNew
,
(
sout_instance_t
*
,
char
*
,
sout_access_out_t
*
)
);
VLC_EXPORT
(
sout_input_t
*
,
sout_MuxAddStream
,
(
sout_mux_t
*
,
sout
_format_t
*
)
);
VLC_EXPORT
(
sout_input_t
*
,
sout_MuxAddStream
,
(
sout_mux_t
*
,
es
_format_t
*
)
);
VLC_EXPORT
(
void
,
sout_MuxDeleteStream
,
(
sout_mux_t
*
,
sout_input_t
*
)
);
VLC_EXPORT
(
void
,
sout_MuxDeleteStream
,
(
sout_mux_t
*
,
sout_input_t
*
)
);
VLC_EXPORT
(
void
,
sout_MuxDelete
,
(
sout_mux_t
*
)
);
VLC_EXPORT
(
void
,
sout_MuxDelete
,
(
sout_mux_t
*
)
);
VLC_EXPORT
(
void
,
sout_MuxSendBuffer
,
(
sout_mux_t
*
,
sout_input_t
*
,
sout_buffer_t
*
)
);
VLC_EXPORT
(
void
,
sout_MuxSendBuffer
,
(
sout_mux_t
*
,
sout_input_t
*
,
sout_buffer_t
*
)
);
...
...
include/vlc_common.h
View file @
bfeea8d6
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
* Collection of useful common types and macros definitions
*****************************************************************************
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.8
7 2003/11/21 00:38:01 gbazin
Exp $
* $Id: vlc_common.h,v 1.8
8 2003/11/21 15:32:08 fenrir
Exp $
*
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
...
@@ -217,6 +217,12 @@ typedef struct pgrm_sys_t pgrm_sys_t;
...
@@ -217,6 +217,12 @@ typedef struct pgrm_sys_t pgrm_sys_t;
typedef
struct
stream_descriptor_t
stream_descriptor_t
;
typedef
struct
stream_descriptor_t
stream_descriptor_t
;
typedef
struct
stream_sys_t
stream_sys_t
;
typedef
struct
stream_sys_t
stream_sys_t
;
/* Format */
typedef
struct
audio_format_t
audio_format_t
;
typedef
struct
video_format_t
video_format_t
;
typedef
struct
subs_format_t
subs_format_t
;
typedef
struct
es_format_t
es_format_t
;
/* NInput */
/* NInput */
typedef
struct
stream_t
stream_t
;
typedef
struct
stream_t
stream_t
;
typedef
struct
es_out_t
es_out_t
;
typedef
struct
es_out_t
es_out_t
;
...
@@ -230,7 +236,6 @@ typedef struct aout_sys_t aout_sys_t;
...
@@ -230,7 +236,6 @@ typedef struct aout_sys_t aout_sys_t;
typedef
struct
aout_fifo_t
aout_fifo_t
;
typedef
struct
aout_fifo_t
aout_fifo_t
;
typedef
struct
aout_input_t
aout_input_t
;
typedef
struct
aout_input_t
aout_input_t
;
typedef
struct
aout_buffer_t
aout_buffer_t
;
typedef
struct
aout_buffer_t
aout_buffer_t
;
typedef
struct
audio_format_t
audio_format_t
;
typedef
audio_format_t
audio_sample_format_t
;
typedef
audio_format_t
audio_sample_format_t
;
typedef
struct
audio_date_t
audio_date_t
;
typedef
struct
audio_date_t
audio_date_t
;
typedef
struct
aout_filter_t
aout_filter_t
;
typedef
struct
aout_filter_t
aout_filter_t
;
...
@@ -239,7 +244,6 @@ typedef struct aout_filter_t aout_filter_t;
...
@@ -239,7 +244,6 @@ typedef struct aout_filter_t aout_filter_t;
typedef
struct
vout_thread_t
vout_thread_t
;
typedef
struct
vout_thread_t
vout_thread_t
;
typedef
struct
vout_sys_t
vout_sys_t
;
typedef
struct
vout_sys_t
vout_sys_t
;
typedef
struct
chroma_sys_t
chroma_sys_t
;
typedef
struct
chroma_sys_t
chroma_sys_t
;
typedef
struct
video_format_t
video_format_t
;
typedef
video_format_t
video_frame_format_t
;
typedef
video_format_t
video_frame_format_t
;
typedef
struct
picture_t
picture_t
;
typedef
struct
picture_t
picture_t
;
typedef
struct
picture_sys_t
picture_sys_t
;
typedef
struct
picture_sys_t
picture_sys_t
;
...
@@ -260,7 +264,6 @@ typedef struct sout_access_out_t sout_access_out_t;
...
@@ -260,7 +264,6 @@ typedef struct sout_access_out_t sout_access_out_t;
typedef
struct
sout_mux_t
sout_mux_t
;
typedef
struct
sout_mux_t
sout_mux_t
;
typedef
struct
sout_stream_t
sout_stream_t
;
typedef
struct
sout_stream_t
sout_stream_t
;
typedef
struct
sout_cfg_t
sout_cfg_t
;
typedef
struct
sout_cfg_t
sout_cfg_t
;
typedef
struct
sout_format_t
sout_format_t
;
/*typedef struct sap_session_t sap_session_t;
/*typedef struct sap_session_t sap_session_t;
typedef struct slp_session_t slp_session_t;*/
typedef struct slp_session_t slp_session_t;*/
...
...
include/vlc_es.h
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* vlc_es.h
* vlc_es.h
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: vlc_es.h,v 1.
1 2003/11/20 22:10:55
fenrir Exp $
* $Id: vlc_es.h,v 1.
2 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -83,16 +83,16 @@ struct video_format_t
...
@@ -83,16 +83,16 @@ struct video_format_t
/**
/**
* Description of subs
* Description of subs
*/
*/
typedef
struct
subs_format_t
struct
subs_format_t
{
{
char
*
psz_encoding
;
char
*
psz_encoding
;
}
subs_format_t
;
};
/**
/**
* ES definition
* ES definition
*/
*/
typedef
struc
t
struct
es_format_
t
{
{
int
i_cat
;
int
i_cat
;
vlc_fourcc_t
i_codec
;
vlc_fourcc_t
i_codec
;
...
@@ -116,7 +116,7 @@ typedef struct
...
@@ -116,7 +116,7 @@ typedef struct
int
i_extra
;
int
i_extra
;
void
*
p_extra
;
void
*
p_extra
;
}
es_format_t
;
};
static
inline
void
es_format_Init
(
es_format_t
*
fmt
,
static
inline
void
es_format_Init
(
es_format_t
*
fmt
,
int
i_cat
,
vlc_fourcc_t
i_codec
)
int
i_cat
,
vlc_fourcc_t
i_codec
)
...
...
modules/mux/asf.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* asf.c
* asf.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* Copyright (C) 2003 VideoLAN
* $Id: asf.c,v 1.
7 2003/08/29 19:49:33
fenrir Exp $
* $Id: asf.c,v 1.
8 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -280,11 +280,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -280,11 +280,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
{
case
AUDIO_ES
:
case
AUDIO_ES
:
{
{
int
i_blockalign
=
p_input
->
p_fmt
->
i_block_
align
;
int
i_blockalign
=
p_input
->
p_fmt
->
audio
.
i_block
align
;
int
i_bitspersample
=
0
;
int
i_bitspersample
=
0
;
int
i_extra
=
0
;
int
i_extra
=
0
;
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
):
case
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
):
tk
->
i_tag
=
WAVE_FORMAT_A52
;
tk
->
i_tag
=
WAVE_FORMAT_A52
;
...
@@ -320,25 +320,25 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -320,25 +320,25 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
case
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
):
case
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
):
tk
->
psz_name
=
"Raw audio 8bits"
;
tk
->
psz_name
=
"Raw audio 8bits"
;
tk
->
i_tag
=
WAVE_FORMAT_PCM
;
tk
->
i_tag
=
WAVE_FORMAT_PCM
;
i_blockalign
=
p_input
->
p_fmt
->
i_channels
;
i_blockalign
=
p_input
->
p_fmt
->
audio
.
i_channels
;
i_bitspersample
=
8
;
i_bitspersample
=
8
;
break
;
break
;
case
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
):
case
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
):
tk
->
psz_name
=
"Raw audio 16bits"
;
tk
->
psz_name
=
"Raw audio 16bits"
;
tk
->
i_tag
=
WAVE_FORMAT_PCM
;
tk
->
i_tag
=
WAVE_FORMAT_PCM
;
i_blockalign
=
2
*
p_input
->
p_fmt
->
i_channels
;
i_blockalign
=
2
*
p_input
->
p_fmt
->
audio
.
i_channels
;
i_bitspersample
=
16
;
i_bitspersample
=
16
;
break
;
break
;
case
VLC_FOURCC
(
's'
,
'2'
,
'4'
,
'l'
):
case
VLC_FOURCC
(
's'
,
'2'
,
'4'
,
'l'
):
tk
->
psz_name
=
"Raw audio 24bits"
;
tk
->
psz_name
=
"Raw audio 24bits"
;
tk
->
i_tag
=
WAVE_FORMAT_PCM
;
tk
->
i_tag
=
WAVE_FORMAT_PCM
;
i_blockalign
=
3
*
p_input
->
p_fmt
->
i_channels
;
i_blockalign
=
3
*
p_input
->
p_fmt
->
audio
.
i_channels
;
i_bitspersample
=
24
;
i_bitspersample
=
24
;
break
;
break
;
case
VLC_FOURCC
(
's'
,
'3'
,
'2'
,
'l'
):
case
VLC_FOURCC
(
's'
,
'3'
,
'2'
,
'l'
):
tk
->
psz_name
=
"Raw audio 32bits"
;
tk
->
psz_name
=
"Raw audio 32bits"
;
tk
->
i_tag
=
WAVE_FORMAT_PCM
;
tk
->
i_tag
=
WAVE_FORMAT_PCM
;
i_blockalign
=
4
*
p_input
->
p_fmt
->
i_channels
;
i_blockalign
=
4
*
p_input
->
p_fmt
->
audio
.
i_channels
;
i_bitspersample
=
32
;
i_bitspersample
=
32
;
break
;
break
;
default:
default:
...
@@ -347,20 +347,20 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -347,20 +347,20 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
tk
->
i_extra
=
sizeof
(
WAVEFORMATEX
)
+
tk
->
i_extra
=
sizeof
(
WAVEFORMATEX
)
+
p_input
->
p_fmt
->
i_extra
_data
+
i_extra
;
p_input
->
p_fmt
->
i_extra
+
i_extra
;
tk
->
p_extra
=
malloc
(
tk
->
i_extra
);
tk
->
p_extra
=
malloc
(
tk
->
i_extra
);
bo_init
(
&
bo
,
tk
->
p_extra
,
tk
->
i_extra
);
bo_init
(
&
bo
,
tk
->
p_extra
,
tk
->
i_extra
);
bo_addle_u16
(
&
bo
,
tk
->
i_tag
);
bo_addle_u16
(
&
bo
,
tk
->
i_tag
);
bo_addle_u16
(
&
bo
,
p_input
->
p_fmt
->
i_channels
);
bo_addle_u16
(
&
bo
,
p_input
->
p_fmt
->
audio
.
i_channels
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_sample
_rate
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
audio
.
i
_rate
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_bitrate
/
8
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_bitrate
/
8
);
bo_addle_u16
(
&
bo
,
i_blockalign
);
bo_addle_u16
(
&
bo
,
i_blockalign
);
bo_addle_u16
(
&
bo
,
i_bitspersample
);
bo_addle_u16
(
&
bo
,
i_bitspersample
);
if
(
p_input
->
p_fmt
->
i_extra
_data
>
0
)
if
(
p_input
->
p_fmt
->
i_extra
>
0
)
{
{
bo_addle_u16
(
&
bo
,
p_input
->
p_fmt
->
i_extra
_data
);
bo_addle_u16
(
&
bo
,
p_input
->
p_fmt
->
i_extra
);
bo_add_mem
(
&
bo
,
p_input
->
p_fmt
->
p_extra
_data
,
bo_add_mem
(
&
bo
,
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
}
}
else
else
{
{
...
@@ -379,7 +379,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -379,7 +379,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
msg_Dbg
(
p_mux
,
"adding mp2 header"
);
msg_Dbg
(
p_mux
,
"adding mp2 header"
);
bo_addle_u16
(
&
bo
,
2
);
/* fwHeadLayer */
bo_addle_u16
(
&
bo
,
2
);
/* fwHeadLayer */
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_bitrate
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_bitrate
);
bo_addle_u16
(
&
bo
,
p_input
->
p_fmt
->
i_channels
==
2
?
1
:
8
);
bo_addle_u16
(
&
bo
,
p_input
->
p_fmt
->
audio
.
i_channels
==
2
?
1
:
8
);
bo_addle_u16
(
&
bo
,
0
);
/* fwHeadModeExt */
bo_addle_u16
(
&
bo
,
0
);
/* fwHeadModeExt */
bo_addle_u16
(
&
bo
,
1
);
/* wHeadEmphasis */
bo_addle_u16
(
&
bo
,
1
);
/* wHeadEmphasis */
bo_addle_u16
(
&
bo
,
16
);
/* fwHeadFlags */
bo_addle_u16
(
&
bo
,
16
);
/* fwHeadFlags */
...
@@ -401,46 +401,46 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -401,46 +401,46 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
case
VIDEO_ES
:
case
VIDEO_ES
:
{
{
tk
->
i_extra
=
11
+
sizeof
(
BITMAPINFOHEADER
)
+
tk
->
i_extra
=
11
+
sizeof
(
BITMAPINFOHEADER
)
+
p_input
->
p_fmt
->
i_extra
_data
;
p_input
->
p_fmt
->
i_extra
;
tk
->
p_extra
=
malloc
(
tk
->
i_extra
);
tk
->
p_extra
=
malloc
(
tk
->
i_extra
);
bo_init
(
&
bo
,
tk
->
p_extra
,
tk
->
i_extra
);
bo_init
(
&
bo
,
tk
->
p_extra
,
tk
->
i_extra
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_width
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
video
.
i_width
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_height
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
video
.
i_height
);
bo_add_u8
(
&
bo
,
0x02
);
/* flags */
bo_add_u8
(
&
bo
,
0x02
);
/* flags */
bo_addle_u16
(
&
bo
,
sizeof
(
BITMAPINFOHEADER
)
+
bo_addle_u16
(
&
bo
,
sizeof
(
BITMAPINFOHEADER
)
+
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
bo_addle_u32
(
&
bo
,
sizeof
(
BITMAPINFOHEADER
)
+
bo_addle_u32
(
&
bo
,
sizeof
(
BITMAPINFOHEADER
)
+
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_width
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
video
.
i_width
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_height
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
video
.
i_height
);
bo_addle_u16
(
&
bo
,
1
);
bo_addle_u16
(
&
bo
,
1
);
bo_addle_u16
(
&
bo
,
24
);
bo_addle_u16
(
&
bo
,
24
);
if
(
p_input
->
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
)
)
if
(
p_input
->
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
)
)
{
{
tk
->
psz_name
=
"MPEG-4 Video"
;
tk
->
psz_name
=
"MPEG-4 Video"
;
tk
->
i_fourcc
=
VLC_FOURCC
(
'M'
,
'P'
,
'4'
,
'S'
);
tk
->
i_fourcc
=
VLC_FOURCC
(
'M'
,
'P'
,
'4'
,
'S'
);
}
}
else
if
(
p_input
->
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'D'
,
'I'
,
'V'
,
'3'
)
)
else
if
(
p_input
->
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'D'
,
'I'
,
'V'
,
'3'
)
)
{
{
tk
->
psz_name
=
"MSMPEG-4 V3 Video"
;
tk
->
psz_name
=
"MSMPEG-4 V3 Video"
;
tk
->
i_fourcc
=
VLC_FOURCC
(
'M'
,
'P'
,
'4'
,
'3'
);
tk
->
i_fourcc
=
VLC_FOURCC
(
'M'
,
'P'
,
'4'
,
'3'
);
}
}
else
if
(
p_input
->
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'D'
,
'I'
,
'V'
,
'2'
)
)
else
if
(
p_input
->
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'D'
,
'I'
,
'V'
,
'2'
)
)
{
{
tk
->
psz_name
=
"MSMPEG-4 V2 Video"
;
tk
->
psz_name
=
"MSMPEG-4 V2 Video"
;
tk
->
i_fourcc
=
VLC_FOURCC
(
'M'
,
'P'
,
'4'
,
'2'
);
tk
->
i_fourcc
=
VLC_FOURCC
(
'M'
,
'P'
,
'4'
,
'2'
);
}
}
else
if
(
p_input
->
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'D'
,
'I'
,
'V'
,
'1'
)
)
else
if
(
p_input
->
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'D'
,
'I'
,
'V'
,
'1'
)
)
{
{
tk
->
psz_name
=
"MSMPEG-4 V1 Video"
;
tk
->
psz_name
=
"MSMPEG-4 V1 Video"
;
tk
->
i_fourcc
=
VLC_FOURCC
(
'M'
,
'P'
,
'G'
,
'4'
);
tk
->
i_fourcc
=
VLC_FOURCC
(
'M'
,
'P'
,
'G'
,
'4'
);
}
}
else
if
(
p_input
->
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'W'
,
'M'
,
'V'
,
'1'
)
)
else
if
(
p_input
->
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'W'
,
'M'
,
'V'
,
'1'
)
)
{
{
tk
->
psz_name
=
"Windows Media Video 1"
;
tk
->
psz_name
=
"Windows Media Video 1"
;
tk
->
i_fourcc
=
VLC_FOURCC
(
'W'
,
'M'
,
'V'
,
'1'
);
tk
->
i_fourcc
=
VLC_FOURCC
(
'W'
,
'M'
,
'V'
,
'1'
);
}
}
else
if
(
p_input
->
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'W'
,
'M'
,
'V'
,
'2'
)
)
else
if
(
p_input
->
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'W'
,
'M'
,
'V'
,
'2'
)
)
{
{
tk
->
psz_name
=
"Windows Media Video 2"
;
tk
->
psz_name
=
"Windows Media Video 2"
;
tk
->
i_fourcc
=
VLC_FOURCC
(
'W'
,
'M'
,
'V'
,
'2'
);
tk
->
i_fourcc
=
VLC_FOURCC
(
'W'
,
'M'
,
'V'
,
'2'
);
...
@@ -448,7 +448,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -448,7 +448,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
else
else
{
{
tk
->
psz_name
=
"Unknow Video"
;
tk
->
psz_name
=
"Unknow Video"
;
tk
->
i_fourcc
=
p_input
->
p_fmt
->
i_
fourc
c
;
tk
->
i_fourcc
=
p_input
->
p_fmt
->
i_
code
c
;
}
}
bo_add_mem
(
&
bo
,
(
uint8_t
*
)
&
tk
->
i_fourcc
,
4
);
bo_add_mem
(
&
bo
,
(
uint8_t
*
)
&
tk
->
i_fourcc
,
4
);
bo_addle_u32
(
&
bo
,
0
);
bo_addle_u32
(
&
bo
,
0
);
...
@@ -456,10 +456,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -456,10 +456,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
bo_addle_u32
(
&
bo
,
0
);
bo_addle_u32
(
&
bo
,
0
);
bo_addle_u32
(
&
bo
,
0
);
bo_addle_u32
(
&
bo
,
0
);
bo_addle_u32
(
&
bo
,
0
);
bo_addle_u32
(
&
bo
,
0
);
if
(
p_input
->
p_fmt
->
i_extra
_data
>
0
)
if
(
p_input
->
p_fmt
->
i_extra
>
0
)
{
{
bo_add_mem
(
&
bo
,
p_input
->
p_fmt
->
p_extra
_data
,
bo_add_mem
(
&
bo
,
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
}
}
if
(
p_input
->
p_fmt
->
i_bitrate
>
50000
)
if
(
p_input
->
p_fmt
->
i_bitrate
>
50000
)
...
...
modules/mux/avi.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* avi.c
* avi.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: avi.c,v 1.1
5 2003/08/17 18:44:26
fenrir Exp $
* $Id: avi.c,v 1.1
6 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -264,22 +264,22 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -264,22 +264,22 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_stream
->
p_bih
=
NULL
;
p_stream
->
p_bih
=
NULL
;
p_stream
->
p_wf
=
malloc
(
sizeof
(
WAVEFORMATEX
)
+
p_stream
->
p_wf
=
malloc
(
sizeof
(
WAVEFORMATEX
)
+
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
#define p_wf p_stream->p_wf
#define p_wf p_stream->p_wf
p_wf
->
cbSize
=
p_input
->
p_fmt
->
i_extra
_data
;
p_wf
->
cbSize
=
p_input
->
p_fmt
->
i_extra
;
if
(
p_wf
->
cbSize
>
0
)
if
(
p_wf
->
cbSize
>
0
)
{
{
memcpy
(
&
p_wf
[
1
],
memcpy
(
&
p_wf
[
1
],
p_input
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
}
}
p_wf
->
nChannels
=
p_input
->
p_fmt
->
i_channels
;
p_wf
->
nChannels
=
p_input
->
p_fmt
->
audio
.
i_channels
;
p_wf
->
nSamplesPerSec
=
p_input
->
p_fmt
->
i_sample
_rate
;
p_wf
->
nSamplesPerSec
=
p_input
->
p_fmt
->
audio
.
i
_rate
;
p_wf
->
nBlockAlign
=
p_input
->
p_fmt
->
i_block_
align
;
p_wf
->
nBlockAlign
=
p_input
->
p_fmt
->
audio
.
i_block
align
;
p_wf
->
nAvgBytesPerSec
=
p_input
->
p_fmt
->
i_bitrate
/
8
;
p_wf
->
nAvgBytesPerSec
=
p_input
->
p_fmt
->
i_bitrate
/
8
;
p_wf
->
wBitsPerSample
=
0
;
p_wf
->
wBitsPerSample
=
0
;
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
):
case
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
):
p_wf
->
wFormatTag
=
WAVE_FORMAT_A52
;
p_wf
->
wFormatTag
=
WAVE_FORMAT_A52
;
...
@@ -334,18 +334,18 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -334,18 +334,18 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
}
}
p_stream
->
p_wf
=
NULL
;
p_stream
->
p_wf
=
NULL
;
p_stream
->
p_bih
=
malloc
(
sizeof
(
BITMAPINFOHEADER
)
+
p_stream
->
p_bih
=
malloc
(
sizeof
(
BITMAPINFOHEADER
)
+
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
#define p_bih p_stream->p_bih
#define p_bih p_stream->p_bih
p_bih
->
biSize
=
sizeof
(
BITMAPINFOHEADER
)
+
p_bih
->
biSize
=
sizeof
(
BITMAPINFOHEADER
)
+
p_input
->
p_fmt
->
i_extra
_data
;
p_input
->
p_fmt
->
i_extra
;
if
(
p_input
->
p_fmt
->
i_extra
_data
>
0
)
if
(
p_input
->
p_fmt
->
i_extra
>
0
)
{
{
memcpy
(
&
p_bih
[
1
],
memcpy
(
&
p_bih
[
1
],
p_input
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
}
}
p_bih
->
biWidth
=
p_input
->
p_fmt
->
i_width
;
p_bih
->
biWidth
=
p_input
->
p_fmt
->
video
.
i_width
;
p_bih
->
biHeight
=
p_input
->
p_fmt
->
i_height
;
p_bih
->
biHeight
=
p_input
->
p_fmt
->
video
.
i_height
;
p_bih
->
biPlanes
=
1
;
p_bih
->
biPlanes
=
1
;
p_bih
->
biBitCount
=
24
;
p_bih
->
biBitCount
=
24
;
p_bih
->
biSizeImage
=
0
;
p_bih
->
biSizeImage
=
0
;
...
@@ -353,13 +353,13 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -353,13 +353,13 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_bih
->
biYPelsPerMeter
=
0
;
p_bih
->
biYPelsPerMeter
=
0
;
p_bih
->
biClrUsed
=
0
;
p_bih
->
biClrUsed
=
0
;
p_bih
->
biClrImportant
=
0
;
p_bih
->
biClrImportant
=
0
;
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
p_bih
->
biCompression
=
VLC_FOURCC
(
'X'
,
'V'
,
'I'
,
'D'
);
p_bih
->
biCompression
=
VLC_FOURCC
(
'X'
,
'V'
,
'I'
,
'D'
);
break
;
break
;
default:
default:
p_bih
->
biCompression
=
p_input
->
p_fmt
->
i_
fourc
c
;
p_bih
->
biCompression
=
p_input
->
p_fmt
->
i_
code
c
;
break
;
break
;
}
}
#undef p_bih
#undef p_bih
...
...
modules/mux/mp4.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* mp4.c: mp4/mov muxer
* mp4.c: mp4/mov muxer
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002, 2003 VideoLAN
* Copyright (C) 2001, 2002, 2003 VideoLAN
* $Id: mp4.c,v 1.
6 2003/10/17 16:40:08 gbazin
Exp $
* $Id: mp4.c,v 1.
7 2003/11/21 15:32:08 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -73,7 +73,7 @@ typedef struct
...
@@ -73,7 +73,7 @@ typedef struct
typedef
struct
typedef
struct
{
{
sout_format_t
*
p_fmt
;
es_format_t
*
p_fmt
;
int
i_track_id
;
int
i_track_id
;
/* index */
/* index */
...
@@ -209,10 +209,10 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
...
@@ -209,10 +209,10 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
int
i_object_type_indication
;
int
i_object_type_indication
;
int
i_decoder_specific_info_size
;
int
i_decoder_specific_info_size
;
if
(
p_stream
->
p_fmt
->
i_extra
_data
>
0
)
if
(
p_stream
->
p_fmt
->
i_extra
>
0
)
{
{
i_decoder_specific_info_size
=
i_decoder_specific_info_size
=
GetDescrLength
(
p_stream
->
p_fmt
->
i_extra
_data
);
GetDescrLength
(
p_stream
->
p_fmt
->
i_extra
);
}
}
else
else
{
{
...
@@ -231,7 +231,7 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
...
@@ -231,7 +231,7 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
/* DecoderConfigDescr */
/* DecoderConfigDescr */
bo_add_descr
(
esds
,
0x04
,
13
+
i_decoder_specific_info_size
);
bo_add_descr
(
esds
,
0x04
,
13
+
i_decoder_specific_info_size
);
switch
(
p_stream
->
p_fmt
->
i_
fourc
c
)
switch
(
p_stream
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
i_object_type_indication
=
0x20
;
i_object_type_indication
=
0x20
;
...
@@ -246,7 +246,7 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
...
@@ -246,7 +246,7 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
break
;
break
;
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
):
i_object_type_indication
=
i_object_type_indication
=
p_stream
->
p_fmt
->
i_sample
_rate
<
32000
?
0x69
:
0x6b
;
p_stream
->
p_fmt
->
audio
.
i
_rate
<
32000
?
0x69
:
0x6b
;
break
;
break
;
default:
default:
i_object_type_indication
=
0x00
;
i_object_type_indication
=
0x00
;
...
@@ -260,16 +260,16 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
...
@@ -260,16 +260,16 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
bo_add_32be
(
esds
,
0x7fffffff
);
// maxBitrate
bo_add_32be
(
esds
,
0x7fffffff
);
// maxBitrate
bo_add_32be
(
esds
,
0
);
// avgBitrate
bo_add_32be
(
esds
,
0
);
// avgBitrate
if
(
p_stream
->
p_fmt
->
i_extra
_data
>
0
)
if
(
p_stream
->
p_fmt
->
i_extra
>
0
)
{
{
int
i
;
int
i
;
/* DecoderSpecificInfo */
/* DecoderSpecificInfo */
bo_add_descr
(
esds
,
0x05
,
p_stream
->
p_fmt
->
i_extra
_data
);
bo_add_descr
(
esds
,
0x05
,
p_stream
->
p_fmt
->
i_extra
);
for
(
i
=
0
;
i
<
p_stream
->
p_fmt
->
i_extra
_data
;
i
++
)
for
(
i
=
0
;
i
<
p_stream
->
p_fmt
->
i_extra
;
i
++
)
{
{
bo_add_8
(
esds
,
p_stream
->
p_fmt
->
p_extra_data
[
i
]
);
bo_add_8
(
esds
,
((
uint8_t
*
)
p_stream
->
p_fmt
->
p_extra
)
[
i
]
);
}
}
}
}
...
@@ -427,7 +427,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -427,7 +427,7 @@ static void Close( vlc_object_t * p_this )
}
}
if
(
p_stream
->
p_fmt
->
i_cat
==
AUDIO_ES
)
if
(
p_stream
->
p_fmt
->
i_cat
==
AUDIO_ES
)
{
{
i_timescale
=
p_stream
->
p_fmt
->
i_sample
_rate
;
i_timescale
=
p_stream
->
p_fmt
->
audio
.
i
_rate
;
}
}
else
else
{
{
...
@@ -480,8 +480,8 @@ static void Close( vlc_object_t * p_this )
...
@@ -480,8 +480,8 @@ static void Close( vlc_object_t * p_this )
}
}
else
else
{
{
bo_add_32be
(
tkhd
,
p_stream
->
p_fmt
->
i_width
<<
16
);
// width (presentation)
bo_add_32be
(
tkhd
,
p_stream
->
p_fmt
->
video
.
i_width
<<
16
);
// width (presentation)
bo_add_32be
(
tkhd
,
p_stream
->
p_fmt
->
i_height
<<
16
);
// height(presentation)
bo_add_32be
(
tkhd
,
p_stream
->
p_fmt
->
video
.
i_height
<<
16
);
// height(presentation)
}
}
box_fix
(
tkhd
);
box_fix
(
tkhd
);
box_gather
(
trak
,
tkhd
);
box_gather
(
trak
,
tkhd
);
...
@@ -599,7 +599,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -599,7 +599,7 @@ static void Close( vlc_object_t * p_this )
int
i
;
int
i
;
vlc_bool_t
b_mpeg4_hdr
;
vlc_bool_t
b_mpeg4_hdr
;
switch
(
p_stream
->
p_fmt
->
i_
fourc
c
)
switch
(
p_stream
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
):
memcpy
(
fcc
,
"mp4a"
,
4
);
memcpy
(
fcc
,
"mp4a"
,
4
);
...
@@ -615,7 +615,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -615,7 +615,7 @@ static void Close( vlc_object_t * p_this )
break
;
break
;
default:
default:
memcpy
(
fcc
,
(
char
*
)
&
p_stream
->
p_fmt
->
i_
fourc
c
,
4
);
memcpy
(
fcc
,
(
char
*
)
&
p_stream
->
p_fmt
->
i_
code
c
,
4
);
b_mpeg4_hdr
=
VLC_FALSE
;
b_mpeg4_hdr
=
VLC_FALSE
;
break
;
break
;
}
}
...
@@ -631,11 +631,11 @@ static void Close( vlc_object_t * p_this )
...
@@ -631,11 +631,11 @@ static void Close( vlc_object_t * p_this )
bo_add_16be
(
soun
,
0
);
// version;
bo_add_16be
(
soun
,
0
);
// version;
bo_add_16be
(
soun
,
0
);
// revision level (0)
bo_add_16be
(
soun
,
0
);
// revision level (0)
bo_add_32be
(
soun
,
0
);
// vendor
bo_add_32be
(
soun
,
0
);
// vendor
bo_add_16be
(
soun
,
p_stream
->
p_fmt
->
i_channels
);
// channel-count
bo_add_16be
(
soun
,
p_stream
->
p_fmt
->
audio
.
i_channels
);
// channel-count
bo_add_16be
(
soun
,
16
);
// FIXME sample size
bo_add_16be
(
soun
,
16
);
// FIXME sample size
bo_add_16be
(
soun
,
-
2
);
// compression id
bo_add_16be
(
soun
,
-
2
);
// compression id
bo_add_16be
(
soun
,
0
);
// packet size (0)
bo_add_16be
(
soun
,
0
);
// packet size (0)
bo_add_16be
(
soun
,
p_stream
->
p_fmt
->
i_sample
_rate
);
// sampleratehi
bo_add_16be
(
soun
,
p_stream
->
p_fmt
->
audio
.
i
_rate
);
// sampleratehi
bo_add_16be
(
soun
,
0
);
// sampleratelo
bo_add_16be
(
soun
,
0
);
// sampleratelo
/* add an ES Descriptor */
/* add an ES Descriptor */
...
@@ -659,7 +659,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -659,7 +659,7 @@ static void Close( vlc_object_t * p_this )
int
i
;
int
i
;
vlc_bool_t
b_mpeg4_hdr
;
vlc_bool_t
b_mpeg4_hdr
;
switch
(
p_stream
->
p_fmt
->
i_
fourc
c
)
switch
(
p_stream
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
...
@@ -673,7 +673,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -673,7 +673,7 @@ static void Close( vlc_object_t * p_this )
break
;
break
;
default:
default:
memcpy
(
fcc
,
(
char
*
)
&
p_stream
->
p_fmt
->
i_
fourc
c
,
4
);
memcpy
(
fcc
,
(
char
*
)
&
p_stream
->
p_fmt
->
i_
code
c
,
4
);
b_mpeg4_hdr
=
VLC_FALSE
;
b_mpeg4_hdr
=
VLC_FALSE
;
break
;
break
;
}
}
...
@@ -692,8 +692,8 @@ static void Close( vlc_object_t * p_this )
...
@@ -692,8 +692,8 @@ static void Close( vlc_object_t * p_this )
bo_add_32be
(
vide
,
0
);
// predefined;
bo_add_32be
(
vide
,
0
);
// predefined;
}
}
bo_add_16be
(
vide
,
p_stream
->
p_fmt
->
i_width
);
// i_width
bo_add_16be
(
vide
,
p_stream
->
p_fmt
->
video
.
i_width
);
// i_width
bo_add_16be
(
vide
,
p_stream
->
p_fmt
->
i_height
);
// i_height
bo_add_16be
(
vide
,
p_stream
->
p_fmt
->
video
.
i_height
);
// i_height
bo_add_32be
(
vide
,
0x00480000
);
// h 72dpi
bo_add_32be
(
vide
,
0x00480000
);
// h 72dpi
bo_add_32be
(
vide
,
0x00480000
);
// v 72dpi
bo_add_32be
(
vide
,
0x00480000
);
// v 72dpi
...
@@ -916,9 +916,9 @@ static void Close( vlc_object_t * p_this )
...
@@ -916,9 +916,9 @@ static void Close( vlc_object_t * p_this )
p_stream
=
p_sys
->
pp_streams
[
i_trak
];
p_stream
=
p_sys
->
pp_streams
[
i_trak
];
if
(
p_stream
->
p_fmt
->
p_extra
_data
)
if
(
p_stream
->
p_fmt
->
p_extra
)
{
{
free
(
p_stream
->
p_fmt
->
p_extra
_data
);
free
(
p_stream
->
p_fmt
->
p_extra
);
}
}
free
(
p_stream
->
p_fmt
);
free
(
p_stream
->
p_fmt
);
free
(
p_stream
->
entry
);
free
(
p_stream
->
entry
);
...
@@ -945,7 +945,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -945,7 +945,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
mp4_stream_t
*
p_stream
;
mp4_stream_t
*
p_stream
;
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
...
@@ -956,20 +956,20 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -956,20 +956,20 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
break
;
break
;
default:
default:
msg_Err
(
p_mux
,
"unsupported codec %4.4s in mp4"
,
msg_Err
(
p_mux
,
"unsupported codec %4.4s in mp4"
,
(
char
*
)
&
p_input
->
p_fmt
->
i_
fourc
c
);
(
char
*
)
&
p_input
->
p_fmt
->
i_
code
c
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
p_stream
=
malloc
(
sizeof
(
mp4_stream_t
)
);
p_stream
=
malloc
(
sizeof
(
mp4_stream_t
)
);
p_stream
->
p_fmt
=
malloc
(
sizeof
(
sout
_format_t
)
);
p_stream
->
p_fmt
=
malloc
(
sizeof
(
es
_format_t
)
);
memcpy
(
p_stream
->
p_fmt
,
p_input
->
p_fmt
,
sizeof
(
sout
_format_t
)
);
memcpy
(
p_stream
->
p_fmt
,
p_input
->
p_fmt
,
sizeof
(
es
_format_t
)
);
if
(
p_stream
->
p_fmt
->
i_extra
_data
)
if
(
p_stream
->
p_fmt
->
i_extra
)
{
{
p_stream
->
p_fmt
->
p_extra
_data
=
p_stream
->
p_fmt
->
p_extra
=
malloc
(
p_stream
->
p_fmt
->
i_extra
_data
);
malloc
(
p_stream
->
p_fmt
->
i_extra
);
memcpy
(
p_stream
->
p_fmt
->
p_extra
_data
,
memcpy
(
p_stream
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
}
}
p_stream
->
i_track_id
=
p_sys
->
i_nb_streams
+
1
;
p_stream
->
i_track_id
=
p_sys
->
i_nb_streams
+
1
;
p_stream
->
i_entry_count
=
0
;
p_stream
->
i_entry_count
=
0
;
...
...
modules/mux/mpeg/ps.c
View file @
bfeea8d6
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* multiplexer module for vlc
* multiplexer module for vlc
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ps.c,v 1.1
5 2003/08/02 01:33:53
fenrir Exp $
* $Id: ps.c,v 1.1
6 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
* Eric Petit <titer@videolan.org>
...
@@ -188,12 +188,12 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -188,12 +188,12 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
ps_stream_t
*
p_stream
;
ps_stream_t
*
p_stream
;
msg_Dbg
(
p_mux
,
"adding input codec=%4.4s"
,
(
char
*
)
&
p_input
->
p_fmt
->
i_
fourc
c
);
msg_Dbg
(
p_mux
,
"adding input codec=%4.4s"
,
(
char
*
)
&
p_input
->
p_fmt
->
i_
code
c
);
p_input
->
p_sys
=
(
void
*
)
p_stream
=
malloc
(
sizeof
(
ps_stream_t
)
);
p_input
->
p_sys
=
(
void
*
)
p_stream
=
malloc
(
sizeof
(
ps_stream_t
)
);
/* Init this new stream */
/* Init this new stream */
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
p_stream
->
i_stream_id
=
StreamIdGet
(
p_sys
->
stream_id_mpgv
,
0xe0
,
0xef
);
p_stream
->
i_stream_id
=
StreamIdGet
(
p_sys
->
stream_id_mpgv
,
0xe0
,
0xef
);
...
@@ -247,7 +247,7 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -247,7 +247,7 @@ static int DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
ps_stream_t
*
p_stream
=
(
ps_stream_t
*
)
p_input
->
p_sys
;
ps_stream_t
*
p_stream
=
(
ps_stream_t
*
)
p_input
->
p_sys
;
msg_Dbg
(
p_mux
,
"removing input"
);
msg_Dbg
(
p_mux
,
"removing input"
);
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
StreamIdRelease
(
p_sys
->
stream_id_mpgv
,
0xe0
,
p_stream
->
i_stream_id
);
StreamIdRelease
(
p_sys
->
stream_id_mpgv
,
0xe0
,
p_stream
->
i_stream_id
);
...
...
modules/mux/mpeg/ts.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ts.c: MPEG-II TS Muxer
* ts.c: MPEG-II TS Muxer
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ts.c,v 1.3
6 2003/11/20 18:26:44
fenrir Exp $
* $Id: ts.c,v 1.3
7 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
* Eric Petit <titer@videolan.org>
...
@@ -411,7 +411,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -411,7 +411,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
ts_stream_t
*
p_stream
;
ts_stream_t
*
p_stream
;
msg_Dbg
(
p_mux
,
"adding input codec=%4.4s"
,
(
char
*
)
&
p_input
->
p_fmt
->
i_
fourc
c
);
msg_Dbg
(
p_mux
,
"adding input codec=%4.4s"
,
(
char
*
)
&
p_input
->
p_fmt
->
i_
code
c
);
p_input
->
p_sys
=
(
void
*
)
p_stream
=
malloc
(
sizeof
(
ts_stream_t
)
);
p_input
->
p_sys
=
(
void
*
)
p_stream
=
malloc
(
sizeof
(
ts_stream_t
)
);
...
@@ -425,7 +425,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -425,7 +425,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
switch
(
p_input
->
p_fmt
->
i_cat
)
switch
(
p_input
->
p_fmt
->
i_cat
)
{
{
case
VIDEO_ES
:
case
VIDEO_ES
:
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
):
/* TODO: do we need to check MPEG-I/II ? */
/* TODO: do we need to check MPEG-I/II ? */
...
@@ -451,9 +451,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -451,9 +451,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
case
VLC_FOURCC
(
'M'
,
'J'
,
'P'
,
'G'
):
case
VLC_FOURCC
(
'M'
,
'J'
,
'P'
,
'G'
):
p_stream
->
i_stream_type
=
0xa0
;
// private
p_stream
->
i_stream_type
=
0xa0
;
// private
p_stream
->
i_stream_id
=
0xa0
;
// beurk
p_stream
->
i_stream_id
=
0xa0
;
// beurk
p_stream
->
i_bih_codec
=
p_input
->
p_fmt
->
i_
fourc
c
;
p_stream
->
i_bih_codec
=
p_input
->
p_fmt
->
i_
code
c
;
p_stream
->
i_bih_width
=
p_input
->
p_fmt
->
i_width
;
p_stream
->
i_bih_width
=
p_input
->
p_fmt
->
video
.
i_width
;
p_stream
->
i_bih_height
=
p_input
->
p_fmt
->
i_height
;
p_stream
->
i_bih_height
=
p_input
->
p_fmt
->
video
.
i_height
;
break
;
break
;
default:
default:
free
(
p_stream
);
free
(
p_stream
);
...
@@ -463,10 +463,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -463,10 +463,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
break
;
break
;
case
AUDIO_ES
:
case
AUDIO_ES
:
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
):
p_stream
->
i_stream_type
=
p_input
->
p_fmt
->
i_sample
_rate
>=
32000
?
0x03
:
0x04
;
p_stream
->
i_stream_type
=
p_input
->
p_fmt
->
audio
.
i
_rate
>=
32000
?
0x03
:
0x04
;
p_stream
->
i_stream_id
=
p_sys
->
i_stream_id_mpga
;
p_stream
->
i_stream_id
=
p_sys
->
i_stream_id_mpga
;
p_sys
->
i_stream_id_mpga
++
;
p_sys
->
i_stream_id_mpga
++
;
break
;
break
;
...
@@ -488,7 +488,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -488,7 +488,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
break
;
break
;
case
SPU_ES
:
case
SPU_ES
:
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
's'
,
'p'
,
'u'
,
' '
):
case
VLC_FOURCC
(
's'
,
'p'
,
'u'
,
' '
):
p_stream
->
i_stream_type
=
0x82
;
p_stream
->
i_stream_type
=
0x82
;
...
@@ -506,14 +506,14 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -506,14 +506,14 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
}
}
/* Copy extra data (VOL for MPEG-4 and extra BitMapInfoHeader for VFW */
/* Copy extra data (VOL for MPEG-4 and extra BitMapInfoHeader for VFW */
p_stream
->
i_decoder_specific_info
=
p_input
->
p_fmt
->
i_extra
_data
;
p_stream
->
i_decoder_specific_info
=
p_input
->
p_fmt
->
i_extra
;
if
(
p_stream
->
i_decoder_specific_info
>
0
)
if
(
p_stream
->
i_decoder_specific_info
>
0
)
{
{
p_stream
->
p_decoder_specific_info
=
p_stream
->
p_decoder_specific_info
=
malloc
(
p_stream
->
i_decoder_specific_info
);
malloc
(
p_stream
->
i_decoder_specific_info
);
memcpy
(
p_stream
->
p_decoder_specific_info
,
memcpy
(
p_stream
->
p_decoder_specific_info
,
p_input
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
}
}
/* Init pes chain */
/* Init pes chain */
...
...
modules/mux/ogg.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ogg.c: ogg muxer module for vlc
* ogg.c: ogg muxer module for vlc
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: ogg.c,v 1.2
0 2003/11/21 13:01:05 gbazin
Exp $
* $Id: ogg.c,v 1.2
1 2003/11/21 15:32:08 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
* Gildas Bazin <gbazin@netcourrier.com>
...
@@ -339,7 +339,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -339,7 +339,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_input
->
p_sys
=
(
void
*
)
p_stream
=
malloc
(
sizeof
(
ogg_stream_t
)
);
p_input
->
p_sys
=
(
void
*
)
p_stream
=
malloc
(
sizeof
(
ogg_stream_t
)
);
p_stream
->
i_cat
=
p_input
->
p_fmt
->
i_cat
;
p_stream
->
i_cat
=
p_input
->
p_fmt
->
i_cat
;
p_stream
->
i_fourcc
=
p_input
->
p_fmt
->
i_
fourc
c
;
p_stream
->
i_fourcc
=
p_input
->
p_fmt
->
i_
code
c
;
p_stream
->
i_serial_no
=
p_sys
->
i_next_serial_no
++
;
p_stream
->
i_serial_no
=
p_sys
->
i_next_serial_no
++
;
p_stream
->
i_packet_no
=
0
;
p_stream
->
i_packet_no
=
0
;
...
@@ -372,9 +372,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -372,9 +372,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
SetDWLE
(
&
p_stream
->
oggds_header
.
i_buffer_size
,
1024
*
1024
);
SetDWLE
(
&
p_stream
->
oggds_header
.
i_buffer_size
,
1024
*
1024
);
SetWLE
(
&
p_stream
->
oggds_header
.
i_bits_per_sample
,
0
);
SetWLE
(
&
p_stream
->
oggds_header
.
i_bits_per_sample
,
0
);
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
video
.
i_width
,
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
video
.
i_width
,
p_input
->
p_fmt
->
i_width
);
p_input
->
p_fmt
->
video
.
i_width
);
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
video
.
i_height
,
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
video
.
i_height
,
p_input
->
p_fmt
->
i_height
);
p_input
->
p_fmt
->
video
.
i_height
);
msg_Dbg
(
p_mux
,
"mp4v/div3 stream"
);
msg_Dbg
(
p_mux
,
"mp4v/div3 stream"
);
break
;
break
;
...
@@ -408,12 +408,12 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
...
@@ -408,12 +408,12 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
SetDWLE
(
&
p_stream
->
oggds_header
.
i_default_len
,
1
);
SetDWLE
(
&
p_stream
->
oggds_header
.
i_default_len
,
1
);
SetDWLE
(
&
p_stream
->
oggds_header
.
i_buffer_size
,
30
*
1024
);
SetDWLE
(
&
p_stream
->
oggds_header
.
i_buffer_size
,
30
*
1024
);
SetQWLE
(
&
p_stream
->
oggds_header
.
i_samples_per_unit
,
SetQWLE
(
&
p_stream
->
oggds_header
.
i_samples_per_unit
,
p_input
->
p_fmt
->
i_sample
_rate
);
p_input
->
p_fmt
->
audio
.
i
_rate
);
SetWLE
(
&
p_stream
->
oggds_header
.
i_bits_per_sample
,
0
);
SetWLE
(
&
p_stream
->
oggds_header
.
i_bits_per_sample
,
0
);
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
audio
.
i_channels
,
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
audio
.
i_channels
,
p_input
->
p_fmt
->
i_channels
);
p_input
->
p_fmt
->
audio
.
i_channels
);
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
audio
.
i_block_align
,
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
audio
.
i_block_align
,
p_input
->
p_fmt
->
i_block_
align
);
p_input
->
p_fmt
->
audio
.
i_block
align
);
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
audio
.
i_avgbytespersec
,
0
);
SetDWLE
(
&
p_stream
->
oggds_header
.
header
.
audio
.
i_avgbytespersec
,
0
);
msg_Dbg
(
p_mux
,
"mpga/a52 stream"
);
msg_Dbg
(
p_mux
,
"mpga/a52 stream"
);
break
;
break
;
...
@@ -710,11 +710,11 @@ static sout_buffer_t *OggCreateHeader( sout_mux_t *p_mux, mtime_t i_dts )
...
@@ -710,11 +710,11 @@ static sout_buffer_t *OggCreateHeader( sout_mux_t *p_mux, mtime_t i_dts )
/* Special case for mp4v */
/* Special case for mp4v */
if
(
p_stream
->
i_fourcc
==
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
)
&&
if
(
p_stream
->
i_fourcc
==
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
)
&&
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_extra
_data
)
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_extra
)
{
{
/* Send a packet with the VOL data */
/* Send a packet with the VOL data */
op
.
bytes
=
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_extra
_data
;
op
.
bytes
=
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_extra
;
op
.
packet
=
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
p_extra
_data
;
op
.
packet
=
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
p_extra
;
op
.
b_o_s
=
0
;
op
.
b_o_s
=
0
;
op
.
e_o_s
=
0
;
op
.
e_o_s
=
0
;
op
.
granulepos
=
0
;
op
.
granulepos
=
0
;
...
@@ -903,7 +903,7 @@ static int Mux( sout_mux_t *p_mux )
...
@@ -903,7 +903,7 @@ static int Mux( sout_mux_t *p_mux )
/* number of sample from begining + current packet */
/* number of sample from begining + current packet */
op
.
granulepos
=
op
.
granulepos
=
(
i_dts
+
p_data
->
i_length
-
p_sys
->
i_start_dts
)
*
(
i_dts
+
p_data
->
i_length
-
p_sys
->
i_start_dts
)
*
p_input
->
p_fmt
->
i_sample
_rate
/
I64C
(
1000000
);
p_input
->
p_fmt
->
audio
.
i
_rate
/
I64C
(
1000000
);
}
}
else
else
{
{
...
...
modules/packetizer/mpegvideo.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* mpegvideo.c
* mpegvideo.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mpegvideo.c,v 1.2
0 2003/11/07 16:53:54 massiot
Exp $
* $Id: mpegvideo.c,v 1.2
1 2003/11/21 15:32:08 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
* Eric Petit <titer@videolan.org>
...
@@ -59,7 +59,7 @@ typedef struct packetizer_s
...
@@ -59,7 +59,7 @@ typedef struct packetizer_s
/* Output properties */
/* Output properties */
sout_packetizer_input_t
*
p_sout_input
;
sout_packetizer_input_t
*
p_sout_input
;
sout_format_t
output_format
;
es_format_t
output_format
;
mtime_t
i_interpolated_dts
;
mtime_t
i_interpolated_dts
;
mtime_t
i_old_duration
;
mtime_t
i_old_duration
;
...
@@ -173,12 +173,12 @@ static int InitThread( packetizer_t *p_pack )
...
@@ -173,12 +173,12 @@ static int InitThread( packetizer_t *p_pack )
{
{
p_pack
->
output_format
.
i_cat
=
VIDEO_ES
;
p_pack
->
output_format
.
i_cat
=
VIDEO_ES
;
p_pack
->
output_format
.
i_
fourc
c
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
p_pack
->
output_format
.
i_
code
c
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
p_pack
->
output_format
.
i_width
=
0
;
p_pack
->
output_format
.
video
.
i_width
=
0
;
p_pack
->
output_format
.
i_height
=
0
;
p_pack
->
output_format
.
video
.
i_height
=
0
;
p_pack
->
output_format
.
i_bitrate
=
0
;
p_pack
->
output_format
.
i_bitrate
=
0
;
p_pack
->
output_format
.
i_extra
_data
=
0
;
p_pack
->
output_format
.
i_extra
=
0
;
p_pack
->
output_format
.
p_extra
_data
=
NULL
;
p_pack
->
output_format
.
p_extra
=
NULL
;
p_pack
->
b_expect_discontinuity
=
0
;
p_pack
->
b_expect_discontinuity
=
0
;
p_pack
->
p_sout_input
=
NULL
;
p_pack
->
p_sout_input
=
NULL
;
...
@@ -273,9 +273,9 @@ static void PacketizeThread( packetizer_t *p_pack )
...
@@ -273,9 +273,9 @@ static void PacketizeThread( packetizer_t *p_pack )
GetChunk
(
&
p_pack
->
bit_stream
,
p_temp
,
4
);
i_pos
+=
4
;
GetChunk
(
&
p_pack
->
bit_stream
,
p_temp
,
4
);
i_pos
+=
4
;
/* horizontal_size_value */
/* horizontal_size_value */
p_pack
->
output_format
.
i_width
=
ShowBits
(
&
p_pack
->
bit_stream
,
12
);
p_pack
->
output_format
.
video
.
i_width
=
ShowBits
(
&
p_pack
->
bit_stream
,
12
);
/* vertical_size_value */
/* vertical_size_value */
p_pack
->
output_format
.
i_height
=
ShowBits
(
&
p_pack
->
bit_stream
,
24
)
&
0xFFF
;
p_pack
->
output_format
.
video
.
i_height
=
ShowBits
(
&
p_pack
->
bit_stream
,
24
)
&
0xFFF
;
/* frame_rate_code */
/* frame_rate_code */
i_frame_rate_code
=
ShowBits
(
&
p_pack
->
bit_stream
,
32
)
&
0xF
;
i_frame_rate_code
=
ShowBits
(
&
p_pack
->
bit_stream
,
32
)
&
0xF
;
...
@@ -327,8 +327,8 @@ static void PacketizeThread( packetizer_t *p_pack )
...
@@ -327,8 +327,8 @@ static void PacketizeThread( packetizer_t *p_pack )
msg_Warn
(
p_pack
->
p_fifo
,
msg_Warn
(
p_pack
->
p_fifo
,
"creating input (image size %dx%d, frame rate %.2f)"
,
"creating input (image size %dx%d, frame rate %.2f)"
,
p_pack
->
output_format
.
i_width
,
p_pack
->
output_format
.
video
.
i_width
,
p_pack
->
output_format
.
i_height
,
p_pack
->
output_format
.
video
.
i_height
,
p_pack
->
d_frame_rate
);
p_pack
->
d_frame_rate
);
/* now we have informations to create the input */
/* now we have informations to create the input */
...
...
modules/stream_out/display.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* display.c
* display.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: display.c,v 1.
6 2003/11/18 16:46:31
fenrir Exp $
* $Id: display.c,v 1.
7 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
@@ -125,7 +125,7 @@ struct sout_stream_id_t
...
@@ -125,7 +125,7 @@ struct sout_stream_id_t
};
};
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_id_t
*
id
;
sout_stream_id_t
*
id
;
...
@@ -155,37 +155,37 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -155,37 +155,37 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
return
NULL
;
return
NULL
;
}
}
id
->
p_es
->
i_stream_id
=
1
;
id
->
p_es
->
i_stream_id
=
1
;
id
->
p_es
->
i_fourcc
=
p_fmt
->
i_
fourc
c
;
id
->
p_es
->
i_fourcc
=
p_fmt
->
i_
code
c
;
id
->
p_es
->
b_force_decoder
=
VLC_TRUE
;
id
->
p_es
->
b_force_decoder
=
VLC_TRUE
;
switch
(
p_fmt
->
i_cat
)
switch
(
p_fmt
->
i_cat
)
{
{
case
AUDIO_ES
:
case
AUDIO_ES
:
id
->
p_es
->
p_bitmapinfoheader
=
NULL
;
id
->
p_es
->
p_bitmapinfoheader
=
NULL
;
id
->
p_es
->
p_waveformatex
=
id
->
p_es
->
p_waveformatex
=
malloc
(
sizeof
(
WAVEFORMATEX
)
+
p_fmt
->
i_extra
_data
);
malloc
(
sizeof
(
WAVEFORMATEX
)
+
p_fmt
->
i_extra
);
#define p_wf ((WAVEFORMATEX*)id->p_es->p_waveformatex)
#define p_wf ((WAVEFORMATEX*)id->p_es->p_waveformatex)
p_wf
->
wFormatTag
=
WAVE_FORMAT_UNKNOWN
;
p_wf
->
wFormatTag
=
WAVE_FORMAT_UNKNOWN
;
p_wf
->
nChannels
=
p_fmt
->
i_channels
;
p_wf
->
nChannels
=
p_fmt
->
audio
.
i_channels
;
p_wf
->
nSamplesPerSec
=
p_fmt
->
i_sample
_rate
;
p_wf
->
nSamplesPerSec
=
p_fmt
->
audio
.
i
_rate
;
p_wf
->
nAvgBytesPerSec
=
p_fmt
->
i_bitrate
/
8
;
p_wf
->
nAvgBytesPerSec
=
p_fmt
->
i_bitrate
/
8
;
p_wf
->
nBlockAlign
=
p_fmt
->
i_block_
align
;
p_wf
->
nBlockAlign
=
p_fmt
->
audio
.
i_block
align
;
p_wf
->
wBitsPerSample
=
0
;
p_wf
->
wBitsPerSample
=
0
;
p_wf
->
cbSize
=
p_fmt
->
i_extra
_data
;
p_wf
->
cbSize
=
p_fmt
->
i_extra
;
if
(
p_fmt
->
i_extra
_data
>
0
)
if
(
p_fmt
->
i_extra
>
0
)
{
{
memcpy
(
&
p_wf
[
1
],
memcpy
(
&
p_wf
[
1
],
p_fmt
->
p_extra
_data
,
p_fmt
->
p_extra
,
p_fmt
->
i_extra
_data
);
p_fmt
->
i_extra
);
}
}
#undef p_wf
#undef p_wf
break
;
break
;
case
VIDEO_ES
:
case
VIDEO_ES
:
id
->
p_es
->
p_waveformatex
=
NULL
;
id
->
p_es
->
p_waveformatex
=
NULL
;
id
->
p_es
->
p_bitmapinfoheader
=
malloc
(
sizeof
(
BITMAPINFOHEADER
)
+
p_fmt
->
i_extra
_data
);
id
->
p_es
->
p_bitmapinfoheader
=
malloc
(
sizeof
(
BITMAPINFOHEADER
)
+
p_fmt
->
i_extra
);
#define p_bih ((BITMAPINFOHEADER*)id->p_es->p_bitmapinfoheader)
#define p_bih ((BITMAPINFOHEADER*)id->p_es->p_bitmapinfoheader)
p_bih
->
biSize
=
sizeof
(
BITMAPINFOHEADER
)
+
p_fmt
->
i_extra
_data
;
p_bih
->
biSize
=
sizeof
(
BITMAPINFOHEADER
)
+
p_fmt
->
i_extra
;
p_bih
->
biWidth
=
p_fmt
->
i_width
;
p_bih
->
biWidth
=
p_fmt
->
video
.
i_width
;
p_bih
->
biHeight
=
p_fmt
->
i_height
;
p_bih
->
biHeight
=
p_fmt
->
video
.
i_height
;
p_bih
->
biPlanes
=
0
;
p_bih
->
biPlanes
=
0
;
p_bih
->
biBitCount
=
0
;
p_bih
->
biBitCount
=
0
;
p_bih
->
biCompression
=
0
;
p_bih
->
biCompression
=
0
;
...
@@ -194,11 +194,11 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -194,11 +194,11 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
p_bih
->
biYPelsPerMeter
=
0
;
p_bih
->
biYPelsPerMeter
=
0
;
p_bih
->
biClrUsed
=
0
;
p_bih
->
biClrUsed
=
0
;
p_bih
->
biClrImportant
=
0
;
p_bih
->
biClrImportant
=
0
;
if
(
p_fmt
->
i_extra
_data
>
0
)
if
(
p_fmt
->
i_extra
>
0
)
{
{
memcpy
(
&
p_bih
[
1
],
memcpy
(
&
p_bih
[
1
],
p_fmt
->
p_extra
_data
,
p_fmt
->
p_extra
,
p_fmt
->
i_extra
_data
);
p_fmt
->
i_extra
);
}
}
#undef p_bih
#undef p_bih
break
;
break
;
...
...
modules/stream_out/dummy.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* dummy.c
* dummy.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: dummy.c,v 1.
1 2003/04/13 20:00:21
fenrir Exp $
* $Id: dummy.c,v 1.
2 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
@@ -82,7 +82,7 @@ struct sout_stream_id_t
...
@@ -82,7 +82,7 @@ struct sout_stream_id_t
};
};
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_stream_id_t
*
id
;
sout_stream_id_t
*
id
;
...
...
modules/stream_out/duplicate.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* duplicate.c
* duplicate.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: duplicate.c,v 1.
4 2003/09/21 11:48:58 gbazin
Exp $
* $Id: duplicate.c,v 1.
5 2003/11/21 15:32:08 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
sout_buffer_t
*
);
...
@@ -134,7 +134,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -134,7 +134,7 @@ static void Close( vlc_object_t * p_this )
free
(
p_sys
);
free
(
p_sys
);
}
}
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_id_t
*
id
;
sout_stream_id_t
*
id
;
...
...
modules/stream_out/es.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* es.c
* es.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: es.c,v 1.
3 2003/07/05 21:31:02 alexis
Exp $
* $Id: es.c,v 1.
4 2003/11/21 15:32:08 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
@@ -186,7 +186,7 @@ static char * es_print_url( char *psz_fmt, vlc_fourcc_t i_fourcc, int i_count, c
...
@@ -186,7 +186,7 @@ static char * es_print_url( char *psz_fmt, vlc_fourcc_t i_fourcc, int i_count, c
return
(
psz_url
);
return
(
psz_url
);
}
}
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_instance_t
*
p_sout
=
p_stream
->
p_sout
;
sout_instance_t
*
p_sout
=
p_stream
->
p_sout
;
...
@@ -230,11 +230,11 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -230,11 +230,11 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
/* *** get url (%d expanded as a codec count, %c expanded as codec fcc ) *** */
/* *** get url (%d expanded as a codec count, %c expanded as codec fcc ) *** */
if
(
p_fmt
->
i_cat
==
AUDIO_ES
&&
p_sys
->
psz_url_audio
)
if
(
p_fmt
->
i_cat
==
AUDIO_ES
&&
p_sys
->
psz_url_audio
)
{
{
psz_url
=
es_print_url
(
p_sys
->
psz_url_audio
,
p_fmt
->
i_
fourc
c
,
p_sys
->
i_count_audio
,
psz_access
,
psz_mux
);
psz_url
=
es_print_url
(
p_sys
->
psz_url_audio
,
p_fmt
->
i_
code
c
,
p_sys
->
i_count_audio
,
psz_access
,
psz_mux
);
}
}
else
if
(
p_fmt
->
i_cat
==
VIDEO_ES
&&
p_sys
->
psz_url_video
)
else
if
(
p_fmt
->
i_cat
==
VIDEO_ES
&&
p_sys
->
psz_url_video
)
{
{
psz_url
=
es_print_url
(
p_sys
->
psz_url_video
,
p_fmt
->
i_
fourc
c
,
p_sys
->
i_count_video
,
psz_access
,
psz_mux
);
psz_url
=
es_print_url
(
p_sys
->
psz_url_video
,
p_fmt
->
i_
code
c
,
p_sys
->
i_count_video
,
psz_access
,
psz_mux
);
}
}
else
else
{
{
...
@@ -252,7 +252,7 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -252,7 +252,7 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
i_count
=
p_sys
->
i_count
;
i_count
=
p_sys
->
i_count
;
}
}
psz_url
=
es_print_url
(
p_sys
->
psz_url
,
p_fmt
->
i_
fourc
c
,
i_count
,
psz_access
,
psz_mux
);
psz_url
=
es_print_url
(
p_sys
->
psz_url
,
p_fmt
->
i_
code
c
,
i_count
,
psz_access
,
psz_mux
);
}
}
p_sys
->
i_count
++
;
p_sys
->
i_count
++
;
...
...
modules/stream_out/gather.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* gather.c
* gather.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: gather.c,v 1.
1 2003/09/07 20:12:44
fenrir Exp $
* $Id: gather.c,v 1.
2 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -46,7 +46,7 @@ vlc_module_end();
...
@@ -46,7 +46,7 @@ vlc_module_end();
/*****************************************************************************
/*****************************************************************************
* Exported prototypes
* Exported prototypes
*****************************************************************************/
*****************************************************************************/
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
@@ -54,7 +54,7 @@ struct sout_stream_id_t
...
@@ -54,7 +54,7 @@ struct sout_stream_id_t
{
{
vlc_bool_t
b_used
;
vlc_bool_t
b_used
;
sout
_format_t
fmt
;
es
_format_t
fmt
;
void
*
id
;
void
*
id
;
};
};
...
@@ -114,7 +114,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -114,7 +114,7 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
/*****************************************************************************
* Add:
* Add:
*****************************************************************************/
*****************************************************************************/
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_id_t
*
id
;
sout_stream_id_t
*
id
;
...
@@ -126,14 +126,14 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
...
@@ -126,14 +126,14 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
id
=
p_sys
->
id
[
i
];
id
=
p_sys
->
id
[
i
];
if
(
!
id
->
b_used
&&
if
(
!
id
->
b_used
&&
id
->
fmt
.
i_cat
==
p_fmt
->
i_cat
&&
id
->
fmt
.
i_cat
==
p_fmt
->
i_cat
&&
id
->
fmt
.
i_
fourcc
==
p_fmt
->
i_fourc
c
&&
id
->
fmt
.
i_
codec
==
p_fmt
->
i_code
c
&&
(
(
id
->
fmt
.
i_cat
==
AUDIO_ES
&&
(
(
id
->
fmt
.
i_cat
==
AUDIO_ES
&&
id
->
fmt
.
i_sample_rate
==
p_fmt
->
i_sample
_rate
&&
id
->
fmt
.
audio
.
i_rate
==
p_fmt
->
audio
.
i
_rate
&&
id
->
fmt
.
i_channels
==
p_fmt
->
i_channels
&&
id
->
fmt
.
audio
.
i_channels
==
p_fmt
->
audio
.
i_channels
&&
id
->
fmt
.
i_block_align
==
p_fmt
->
i_block_
align
)
||
id
->
fmt
.
audio
.
i_blockalign
==
p_fmt
->
audio
.
i_block
align
)
||
(
id
->
fmt
.
i_cat
==
VIDEO_ES
&&
(
id
->
fmt
.
i_cat
==
VIDEO_ES
&&
id
->
fmt
.
i_width
==
p_fmt
->
i_width
&&
id
->
fmt
.
video
.
i_width
==
p_fmt
->
video
.
i_width
&&
id
->
fmt
.
i_height
==
p_fmt
->
i_height
)
)
)
id
->
fmt
.
video
.
i_height
==
p_fmt
->
video
.
i_height
)
)
)
{
{
msg_Dbg
(
p_stream
,
"reusing already opened output"
);
msg_Dbg
(
p_stream
,
"reusing already opened output"
);
id
->
b_used
=
VLC_TRUE
;
id
->
b_used
=
VLC_TRUE
;
...
@@ -158,9 +158,9 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
...
@@ -158,9 +158,9 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
id
=
malloc
(
sizeof
(
sout_stream_id_t
)
);
id
=
malloc
(
sizeof
(
sout_stream_id_t
)
);
msg_Dbg
(
p_stream
,
"creating new output"
);
msg_Dbg
(
p_stream
,
"creating new output"
);
memcpy
(
&
id
->
fmt
,
p_fmt
,
sizeof
(
sout
_format_t
)
);
memcpy
(
&
id
->
fmt
,
p_fmt
,
sizeof
(
es
_format_t
)
);
id
->
fmt
.
i_extra
_data
=
0
;
id
->
fmt
.
i_extra
=
0
;
id
->
fmt
.
p_extra
_data
=
NULL
;
id
->
fmt
.
p_extra
=
NULL
;
id
->
b_used
=
VLC_TRUE
;
id
->
b_used
=
VLC_TRUE
;
id
->
id
=
p_sys
->
p_out
->
pf_add
(
p_sys
->
p_out
,
p_fmt
);
id
->
id
=
p_sys
->
p_out
->
pf_add
(
p_sys
->
p_out
,
p_fmt
);
if
(
id
->
id
==
NULL
)
if
(
id
->
id
==
NULL
)
...
...
modules/stream_out/rtp.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* rtp.c
* rtp.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* Copyright (C) 2003 VideoLAN
* $Id: rtp.c,v 1.
6 2003/11/07 18:32:24
fenrir Exp $
* $Id: rtp.c,v 1.
7 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -49,7 +49,7 @@ vlc_module_end();
...
@@ -49,7 +49,7 @@ vlc_module_end();
/*****************************************************************************
/*****************************************************************************
* Exported prototypes
* Exported prototypes
*****************************************************************************/
*****************************************************************************/
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
@@ -456,7 +456,7 @@ static void sprintf_hexa( char *s, uint8_t *p_data, int i_data )
...
@@ -456,7 +456,7 @@ static void sprintf_hexa( char *s, uint8_t *p_data, int i_data )
s
[
2
*
i_data
]
=
'\0'
;
s
[
2
*
i_data
]
=
'\0'
;
}
}
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_instance_t
*
p_sout
=
p_stream
->
p_sout
;
sout_instance_t
*
p_sout
=
p_stream
->
p_sout
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
...
@@ -509,14 +509,14 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -509,14 +509,14 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
id
->
psz_destination
=
strdup
(
p_sys
->
psz_destination
);
id
->
psz_destination
=
strdup
(
p_sys
->
psz_destination
);
id
->
i_port
=
p_sys
->
i_port
;
id
->
i_port
=
p_sys
->
i_port
;
switch
(
p_fmt
->
i_
fourc
c
)
switch
(
p_fmt
->
i_
code
c
)
{
{
case
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'b'
):
case
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'b'
):
if
(
p_fmt
->
i_channels
==
1
&&
p_fmt
->
i_sample
_rate
==
44100
)
if
(
p_fmt
->
audio
.
i_channels
==
1
&&
p_fmt
->
audio
.
i
_rate
==
44100
)
{
{
id
->
i_payload_type
=
11
;
id
->
i_payload_type
=
11
;
}
}
else
if
(
p_fmt
->
i_channels
==
2
&&
p_fmt
->
i_sample
_rate
==
44100
)
else
if
(
p_fmt
->
audio
.
i_channels
==
2
&&
p_fmt
->
audio
.
i
_rate
==
44100
)
{
{
id
->
i_payload_type
=
10
;
id
->
i_payload_type
=
10
;
}
}
...
@@ -525,15 +525,15 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -525,15 +525,15 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
}
}
id
->
psz_rtpmap
=
malloc
(
strlen
(
"L16/*/*"
)
+
20
+
1
);
id
->
psz_rtpmap
=
malloc
(
strlen
(
"L16/*/*"
)
+
20
+
1
);
sprintf
(
id
->
psz_rtpmap
,
"L16/%d/%d"
,
p_fmt
->
i_sample_rate
,
p_fmt
->
i_channels
);
sprintf
(
id
->
psz_rtpmap
,
"L16/%d/%d"
,
p_fmt
->
audio
.
i_rate
,
p_fmt
->
audio
.
i_channels
);
id
->
i_clock_rate
=
p_fmt
->
i_sample
_rate
;
id
->
i_clock_rate
=
p_fmt
->
audio
.
i
_rate
;
id
->
pf_packetize
=
rtp_packetize_l16
;
id
->
pf_packetize
=
rtp_packetize_l16
;
break
;
break
;
case
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
):
case
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
):
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
id
->
psz_rtpmap
=
malloc
(
strlen
(
"L8/*/*"
)
+
20
+
1
);
id
->
psz_rtpmap
=
malloc
(
strlen
(
"L8/*/*"
)
+
20
+
1
);
sprintf
(
id
->
psz_rtpmap
,
"L8/%d/%d"
,
p_fmt
->
i_sample_rate
,
p_fmt
->
i_channels
);
sprintf
(
id
->
psz_rtpmap
,
"L8/%d/%d"
,
p_fmt
->
audio
.
i_rate
,
p_fmt
->
audio
.
i_channels
);
id
->
i_clock_rate
=
p_fmt
->
i_sample
_rate
;
id
->
i_clock_rate
=
p_fmt
->
audio
.
i
_rate
;
id
->
pf_packetize
=
rtp_packetize_l8
;
id
->
pf_packetize
=
rtp_packetize_l8
;
break
;
break
;
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
):
...
@@ -556,16 +556,16 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -556,16 +556,16 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
break
;
break
;
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
):
{
{
char
hexa
[
2
*
p_fmt
->
i_extra
_data
+
1
];
char
hexa
[
2
*
p_fmt
->
i_extra
+
1
];
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
id
->
i_clock_rate
=
90000
;
id
->
i_clock_rate
=
90000
;
id
->
psz_rtpmap
=
strdup
(
"MP4V-ES/90000"
);
id
->
psz_rtpmap
=
strdup
(
"MP4V-ES/90000"
);
id
->
pf_packetize
=
rtp_packetize_split
;
id
->
pf_packetize
=
rtp_packetize_split
;
if
(
p_fmt
->
i_extra
_data
>
0
)
if
(
p_fmt
->
i_extra
>
0
)
{
{
id
->
psz_fmtp
=
malloc
(
100
+
2
*
p_fmt
->
i_extra
_data
);
id
->
psz_fmtp
=
malloc
(
100
+
2
*
p_fmt
->
i_extra
);
sprintf_hexa
(
hexa
,
p_fmt
->
p_extra
_data
,
p_fmt
->
i_extra_dat
a
);
sprintf_hexa
(
hexa
,
p_fmt
->
p_extra
,
p_fmt
->
i_extr
a
);
sprintf
(
id
->
psz_fmtp
,
sprintf
(
id
->
psz_fmtp
,
"profile-level-id=3; config=%s"
,
hexa
);
"profile-level-id=3; config=%s"
,
hexa
);
}
}
...
@@ -573,15 +573,15 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -573,15 +573,15 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
}
}
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
):
{
{
char
hexa
[
2
*
p_fmt
->
i_extra
_data
+
1
];
char
hexa
[
2
*
p_fmt
->
i_extra
+
1
];
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
id
->
i_clock_rate
=
p_fmt
->
i_sample
_rate
;
id
->
i_clock_rate
=
p_fmt
->
audio
.
i
_rate
;
id
->
psz_rtpmap
=
malloc
(
strlen
(
"mpeg4-generic/"
)
+
12
);
id
->
psz_rtpmap
=
malloc
(
strlen
(
"mpeg4-generic/"
)
+
12
);
sprintf
(
id
->
psz_rtpmap
,
"mpeg4-generic/%d"
,
p_fmt
->
i_sample
_rate
);
sprintf
(
id
->
psz_rtpmap
,
"mpeg4-generic/%d"
,
p_fmt
->
audio
.
i
_rate
);
id
->
pf_packetize
=
rtp_packetize_mp4a
;
id
->
pf_packetize
=
rtp_packetize_mp4a
;
id
->
psz_fmtp
=
malloc
(
200
+
2
*
p_fmt
->
i_extra
_data
);
id
->
psz_fmtp
=
malloc
(
200
+
2
*
p_fmt
->
i_extra
);
sprintf_hexa
(
hexa
,
p_fmt
->
p_extra
_data
,
p_fmt
->
i_extra_dat
a
);
sprintf_hexa
(
hexa
,
p_fmt
->
p_extra
,
p_fmt
->
i_extr
a
);
sprintf
(
id
->
psz_fmtp
,
sprintf
(
id
->
psz_fmtp
,
"streamtype=5; profile-level-id=15; mode=AAC-hbr; config=%s; "
"streamtype=5; profile-level-id=15; mode=AAC-hbr; config=%s; "
"SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;"
,
hexa
);
"SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;"
,
hexa
);
...
@@ -589,7 +589,7 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
...
@@ -589,7 +589,7 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
}
}
default:
default:
msg_Err
(
p_stream
,
"cannot add this stream (unsupported codec:%4.4s)"
,
(
char
*
)
&
p_fmt
->
i_
fourc
c
);
msg_Err
(
p_stream
,
"cannot add this stream (unsupported codec:%4.4s)"
,
(
char
*
)
&
p_fmt
->
i_
code
c
);
free
(
id
);
free
(
id
);
return
NULL
;
return
NULL
;
}
}
...
...
modules/stream_out/standard.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* standard.c
* standard.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: standard.c,v 1.1
5 2003/09/13 17:44:13
fenrir Exp $
* $Id: standard.c,v 1.1
6 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
@@ -341,7 +341,7 @@ struct sout_stream_id_t
...
@@ -341,7 +341,7 @@ struct sout_stream_id_t
};
};
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_id_t
*
id
;
sout_stream_id_t
*
id
;
...
...
modules/stream_out/transcode.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* transcode.c
* transcode.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: transcode.c,v 1.5
1 2003/11/17 02:55:22
fenrir Exp $
* $Id: transcode.c,v 1.5
2 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
* Gildas Bazin <gbazin@netcourrier.com>
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
@@ -316,8 +316,8 @@ static void Close( vlc_object_t * p_this )
...
@@ -316,8 +316,8 @@ static void Close( vlc_object_t * p_this )
struct
sout_stream_id_t
struct
sout_stream_id_t
{
{
vlc_fourcc_t
b_transcode
;
vlc_fourcc_t
b_transcode
;
sout
_format_t
f_src
;
/* only if transcoding */
es
_format_t
f_src
;
/* only if transcoding */
sout
_format_t
f_dst
;
/* " " " */
es
_format_t
f_dst
;
/* " " " */
unsigned
int
i_inter_pixfmt
;
/* intermediary format when transcoding */
unsigned
int
i_inter_pixfmt
;
/* intermediary format when transcoding */
/* id of the out stream */
/* id of the out stream */
...
@@ -347,7 +347,7 @@ struct sout_stream_id_t
...
@@ -347,7 +347,7 @@ struct sout_stream_id_t
};
};
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_id_t
*
id
;
sout_stream_id_t
*
id
;
...
@@ -361,21 +361,21 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
...
@@ -361,21 +361,21 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
{
{
msg_Dbg
(
p_stream
,
msg_Dbg
(
p_stream
,
"creating audio transcoding from fcc=`%4.4s' to fcc=`%4.4s'"
,
"creating audio transcoding from fcc=`%4.4s' to fcc=`%4.4s'"
,
(
char
*
)
&
p_fmt
->
i_
fourc
c
,
(
char
*
)
&
p_fmt
->
i_
code
c
,
(
char
*
)
&
p_sys
->
i_acodec
);
(
char
*
)
&
p_sys
->
i_acodec
);
/* src format */
/* src format */
memcpy
(
&
id
->
f_src
,
p_fmt
,
sizeof
(
sout
_format_t
)
);
memcpy
(
&
id
->
f_src
,
p_fmt
,
sizeof
(
es
_format_t
)
);
/* create dst format */
/* create dst format */
id
->
f_dst
.
i_cat
=
AUDIO_ES
;
id
->
f_dst
.
i_cat
=
AUDIO_ES
;
id
->
f_dst
.
i_
fourc
c
=
p_sys
->
i_acodec
;
id
->
f_dst
.
i_
code
c
=
p_sys
->
i_acodec
;
id
->
f_dst
.
i_sample_rate
=
p_sys
->
i_sample_rate
>
0
?
p_sys
->
i_sample_rate
:
id
->
f_src
.
i_sample
_rate
;
id
->
f_dst
.
audio
.
i_rate
=
p_sys
->
i_sample_rate
>
0
?
p_sys
->
i_sample_rate
:
id
->
f_src
.
audio
.
i
_rate
;
id
->
f_dst
.
i_channels
=
p_sys
->
i_channels
>
0
?
p_sys
->
i_channels
:
id
->
f_src
.
i_channels
;
id
->
f_dst
.
audio
.
i_channels
=
p_sys
->
i_channels
>
0
?
p_sys
->
i_channels
:
id
->
f_src
.
audio
.
i_channels
;
id
->
f_dst
.
i_bitrate
=
p_sys
->
i_abitrate
>
0
?
p_sys
->
i_abitrate
:
64000
;
id
->
f_dst
.
i_bitrate
=
p_sys
->
i_abitrate
>
0
?
p_sys
->
i_abitrate
:
64000
;
id
->
f_dst
.
i_block_
align
=
0
;
id
->
f_dst
.
audio
.
i_block
align
=
0
;
id
->
f_dst
.
i_extra
_data
=
0
;
id
->
f_dst
.
i_extra
=
0
;
id
->
f_dst
.
p_extra
_data
=
NULL
;
id
->
f_dst
.
p_extra
=
NULL
;
/* build decoder -> filter -> encoder */
/* build decoder -> filter -> encoder */
if
(
transcode_audio_ffmpeg_new
(
p_stream
,
id
)
)
if
(
transcode_audio_ffmpeg_new
(
p_stream
,
id
)
)
...
@@ -399,19 +399,19 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
...
@@ -399,19 +399,19 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
{
{
msg_Dbg
(
p_stream
,
msg_Dbg
(
p_stream
,
"creating video transcoding from fcc=`%4.4s' to fcc=`%4.4s'"
,
"creating video transcoding from fcc=`%4.4s' to fcc=`%4.4s'"
,
(
char
*
)
&
p_fmt
->
i_
fourc
c
,
(
char
*
)
&
p_fmt
->
i_
code
c
,
(
char
*
)
&
p_sys
->
i_vcodec
);
(
char
*
)
&
p_sys
->
i_vcodec
);
memcpy
(
&
id
->
f_src
,
p_fmt
,
sizeof
(
sout
_format_t
)
);
memcpy
(
&
id
->
f_src
,
p_fmt
,
sizeof
(
es
_format_t
)
);
/* create dst format */
/* create dst format */
id
->
f_dst
.
i_cat
=
VIDEO_ES
;
id
->
f_dst
.
i_cat
=
VIDEO_ES
;
id
->
f_dst
.
i_
fourcc
=
p_sys
->
i_vcodec
;
id
->
f_dst
.
i_
codec
=
p_sys
->
i_vcodec
;
id
->
f_dst
.
i_width
=
p_sys
->
i_width
;
/* > 0 ? p_sys->i_width : id->f_src.i_width; */
id
->
f_dst
.
video
.
i_width
=
p_sys
->
i_width
;
/* > 0 ? p_sys->i_width : id->f_src.i_width; */
id
->
f_dst
.
i_height
=
p_sys
->
i_height
;
/* > 0 ? p_sys->i_height: id->f_src.i_height; */
id
->
f_dst
.
video
.
i_height
=
p_sys
->
i_height
;
/* > 0 ? p_sys->i_height: id->f_src.i_height; */
id
->
f_dst
.
i_bitrate
=
p_sys
->
i_vbitrate
>
0
?
p_sys
->
i_vbitrate
:
800
*
1000
;
id
->
f_dst
.
i_bitrate
=
p_sys
->
i_vbitrate
>
0
?
p_sys
->
i_vbitrate
:
800
*
1000
;
id
->
f_dst
.
i_extra
_data
=
0
;
id
->
f_dst
.
i_extra
=
0
;
id
->
f_dst
.
p_extra
_data
=
NULL
;
id
->
f_dst
.
p_extra
=
NULL
;
/* build decoder -> filter -> encoder */
/* build decoder -> filter -> encoder */
if
(
transcode_video_ffmpeg_new
(
p_stream
,
id
)
)
if
(
transcode_video_ffmpeg_new
(
p_stream
,
id
)
)
...
@@ -428,7 +428,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
...
@@ -428,7 +428,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
}
}
else
else
{
{
msg_Dbg
(
p_stream
,
"not transcoding a stream (fcc=`%4.4s')"
,
(
char
*
)
&
p_fmt
->
i_
fourc
c
);
msg_Dbg
(
p_stream
,
"not transcoding a stream (fcc=`%4.4s')"
,
(
char
*
)
&
p_fmt
->
i_
code
c
);
id
->
id
=
p_sys
->
p_out
->
pf_add
(
p_sys
->
p_out
,
p_fmt
);
id
->
id
=
p_sys
->
p_out
->
pf_add
(
p_sys
->
p_out
,
p_fmt
);
id
->
b_transcode
=
VLC_FALSE
;
id
->
b_transcode
=
VLC_FALSE
;
...
@@ -636,23 +636,23 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -636,23 +636,23 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
{
{
int
i_ff_codec
;
int
i_ff_codec
;
if
(
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
)
||
if
(
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'b'
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'b'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
's'
,
'8'
,
' '
,
' '
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
's'
,
'8'
,
' '
,
' '
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
)
)
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
)
)
{
{
id
->
ff_dec
=
NULL
;
id
->
ff_dec
=
NULL
;
id
->
ff_dec_c
=
avcodec_alloc_context
();
id
->
ff_dec_c
=
avcodec_alloc_context
();
id
->
ff_dec_c
->
sample_rate
=
id
->
f_src
.
i_sample
_rate
;
id
->
ff_dec_c
->
sample_rate
=
id
->
f_src
.
audio
.
i
_rate
;
id
->
ff_dec_c
->
channels
=
id
->
f_src
.
i_channels
;
id
->
ff_dec_c
->
channels
=
id
->
f_src
.
audio
.
i_channels
;
id
->
ff_dec_c
->
block_align
=
id
->
f_src
.
i_block_
align
;
id
->
ff_dec_c
->
block_align
=
id
->
f_src
.
audio
.
i_block
align
;
id
->
ff_dec_c
->
bit_rate
=
id
->
f_src
.
i_bitrate
;
id
->
ff_dec_c
->
bit_rate
=
id
->
f_src
.
i_bitrate
;
}
}
else
else
{
{
/* find decoder */
/* find decoder */
i_ff_codec
=
get_ff_codec
(
id
->
f_src
.
i_
fourc
c
);
i_ff_codec
=
get_ff_codec
(
id
->
f_src
.
i_
code
c
);
if
(
i_ff_codec
==
0
)
if
(
i_ff_codec
==
0
)
{
{
msg_Err
(
p_stream
,
"cannot find decoder id"
);
msg_Err
(
p_stream
,
"cannot find decoder id"
);
...
@@ -667,13 +667,13 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -667,13 +667,13 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
}
}
id
->
ff_dec_c
=
avcodec_alloc_context
();
id
->
ff_dec_c
=
avcodec_alloc_context
();
id
->
ff_dec_c
->
sample_rate
=
id
->
f_src
.
i_sample
_rate
;
id
->
ff_dec_c
->
sample_rate
=
id
->
f_src
.
audio
.
i
_rate
;
id
->
ff_dec_c
->
channels
=
id
->
f_src
.
i_channels
;
id
->
ff_dec_c
->
channels
=
id
->
f_src
.
audio
.
i_channels
;
id
->
ff_dec_c
->
block_align
=
id
->
f_src
.
i_block_
align
;
id
->
ff_dec_c
->
block_align
=
id
->
f_src
.
audio
.
i_block
align
;
id
->
ff_dec_c
->
bit_rate
=
id
->
f_src
.
i_bitrate
;
id
->
ff_dec_c
->
bit_rate
=
id
->
f_src
.
i_bitrate
;
id
->
ff_dec_c
->
extradata_size
=
id
->
f_src
.
i_extra
_data
;
id
->
ff_dec_c
->
extradata_size
=
id
->
f_src
.
i_extra
;
id
->
ff_dec_c
->
extradata
=
id
->
f_src
.
p_extra
_data
;
id
->
ff_dec_c
->
extradata
=
id
->
f_src
.
p_extra
;
if
(
avcodec_open
(
id
->
ff_dec_c
,
id
->
ff_dec
)
)
if
(
avcodec_open
(
id
->
ff_dec_c
,
id
->
ff_dec
)
)
{
{
msg_Err
(
p_stream
,
"cannot open decoder"
);
msg_Err
(
p_stream
,
"cannot open decoder"
);
...
@@ -686,7 +686,7 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -686,7 +686,7 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
id
->
p_buffer
=
malloc
(
id
->
i_buffer
);
id
->
p_buffer
=
malloc
(
id
->
i_buffer
);
/* Sanity check for audio channels */
/* Sanity check for audio channels */
id
->
f_dst
.
i_channels
=
__MIN
(
id
->
f_dst
.
i_channels
,
id
->
f_src
.
i_channels
);
id
->
f_dst
.
audio
.
i_channels
=
__MIN
(
id
->
f_dst
.
audio
.
i_channels
,
id
->
f_src
.
audio
.
i_channels
);
/* find encoder */
/* find encoder */
id
->
p_encoder
=
vlc_object_create
(
p_stream
,
VLC_OBJECT_ENCODER
);
id
->
p_encoder
=
vlc_object_create
(
p_stream
,
VLC_OBJECT_ENCODER
);
...
@@ -694,14 +694,14 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -694,14 +694,14 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
/* Initialization of encoder format structures */
/* Initialization of encoder format structures */
es_format_Init
(
&
id
->
p_encoder
->
fmt_in
,
AUDIO_ES
,
AOUT_FMT_S16_NE
);
es_format_Init
(
&
id
->
p_encoder
->
fmt_in
,
AUDIO_ES
,
AOUT_FMT_S16_NE
);
id
->
p_encoder
->
fmt_in
.
audio
.
i_format
=
AOUT_FMT_S16_NE
;
id
->
p_encoder
->
fmt_in
.
audio
.
i_format
=
AOUT_FMT_S16_NE
;
id
->
p_encoder
->
fmt_in
.
audio
.
i_rate
=
id
->
f_dst
.
i_sample
_rate
;
id
->
p_encoder
->
fmt_in
.
audio
.
i_rate
=
id
->
f_dst
.
audio
.
i
_rate
;
id
->
p_encoder
->
fmt_in
.
audio
.
i_physical_channels
=
id
->
p_encoder
->
fmt_in
.
audio
.
i_physical_channels
=
id
->
p_encoder
->
fmt_in
.
audio
.
i_original_channels
=
id
->
p_encoder
->
fmt_in
.
audio
.
i_original_channels
=
pi_channels_maps
[
id
->
f_dst
.
i_channels
];
pi_channels_maps
[
id
->
f_dst
.
audio
.
i_channels
];
id
->
p_encoder
->
fmt_in
.
audio
.
i_channels
=
id
->
f_dst
.
i_channels
;
id
->
p_encoder
->
fmt_in
.
audio
.
i_channels
=
id
->
f_dst
.
audio
.
i_channels
;
id
->
p_encoder
->
fmt_out
=
id
->
p_encoder
->
fmt_in
;
id
->
p_encoder
->
fmt_out
=
id
->
p_encoder
->
fmt_in
;
id
->
p_encoder
->
fmt_out
.
i_codec
=
id
->
f_dst
.
i_
fourc
c
;
id
->
p_encoder
->
fmt_out
.
i_codec
=
id
->
f_dst
.
i_
code
c
;
id
->
p_encoder
->
fmt_out
.
i_bitrate
=
id
->
f_dst
.
i_bitrate
;
id
->
p_encoder
->
fmt_out
.
i_bitrate
=
id
->
f_dst
.
i_bitrate
;
id
->
p_encoder
->
p_module
=
id
->
p_encoder
->
p_module
=
...
@@ -715,13 +715,13 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -715,13 +715,13 @@ static int transcode_audio_ffmpeg_new( sout_stream_t *p_stream,
id
->
b_enc_inited
=
VLC_FALSE
;
id
->
b_enc_inited
=
VLC_FALSE
;
id
->
f_dst
.
i_extra
_data
=
id
->
p_encoder
->
fmt_out
.
i_extra
;
id
->
f_dst
.
i_extra
=
id
->
p_encoder
->
fmt_out
.
i_extra
;
id
->
f_dst
.
p_extra
_data
=
id
->
p_encoder
->
fmt_out
.
p_extra
;
id
->
f_dst
.
p_extra
=
id
->
p_encoder
->
fmt_out
.
p_extra
;
/* Hack for mp3 transcoding support */
/* Hack for mp3 transcoding support */
if
(
id
->
f_dst
.
i_
fourc
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'3'
,
' '
)
)
if
(
id
->
f_dst
.
i_
code
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'3'
,
' '
)
)
{
{
id
->
f_dst
.
i_
fourc
c
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
);
id
->
f_dst
.
i_
code
c
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
);
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -784,14 +784,14 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream,
...
@@ -784,14 +784,14 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream,
{
{
int16_t
*
sout
=
(
int16_t
*
)
id
->
p_buffer
;
int16_t
*
sout
=
(
int16_t
*
)
id
->
p_buffer
;
if
(
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
's'
,
'8'
,
' '
,
' '
)
||
if
(
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
's'
,
'8'
,
' '
,
' '
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
)
)
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
)
)
{
{
int8_t
*
sin
=
(
int8_t
*
)
p_buffer
;
int8_t
*
sin
=
(
int8_t
*
)
p_buffer
;
int
i_used
=
__MIN
(
id
->
i_buffer
/
2
,
i_buffer
);
int
i_used
=
__MIN
(
id
->
i_buffer
/
2
,
i_buffer
);
int
i_samples
=
i_used
;
int
i_samples
=
i_used
;
if
(
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
's'
,
'8'
,
' '
,
' '
)
)
if
(
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
's'
,
'8'
,
' '
,
' '
)
)
while
(
i_samples
>
0
)
while
(
i_samples
>
0
)
{
{
*
sout
++
=
(
*
sin
++
)
<<
8
;
*
sout
++
=
(
*
sin
++
)
<<
8
;
...
@@ -808,15 +808,15 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream,
...
@@ -808,15 +808,15 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream,
p_buffer
+=
i_used
;
p_buffer
+=
i_used
;
id
->
i_buffer_pos
=
i_used
*
2
;
id
->
i_buffer_pos
=
i_used
*
2
;
}
}
else
if
(
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
)
||
else
if
(
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'b'
)
)
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'b'
)
)
{
{
int16_t
*
sin
=
(
int16_t
*
)
p_buffer
;
int16_t
*
sin
=
(
int16_t
*
)
p_buffer
;
int
i_used
=
__MIN
(
id
->
i_buffer
,
i_buffer
);
int
i_used
=
__MIN
(
id
->
i_buffer
,
i_buffer
);
int
i_samples
=
i_used
/
2
;
int
i_samples
=
i_used
/
2
;
int
b_invert_indianness
;
int
b_invert_indianness
;
if
(
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
)
)
if
(
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
)
)
#ifdef WORDS_BIGENDIAN
#ifdef WORDS_BIGENDIAN
b_invert_indianness
=
1
;
b_invert_indianness
=
1
;
#else
#else
...
@@ -879,12 +879,12 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream,
...
@@ -879,12 +879,12 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream,
aout_buf
.
p_buffer
=
id
->
p_buffer
;
aout_buf
.
p_buffer
=
id
->
p_buffer
;
aout_buf
.
i_nb_bytes
=
id
->
i_buffer_pos
;
aout_buf
.
i_nb_bytes
=
id
->
i_buffer_pos
;
aout_buf
.
i_nb_samples
=
id
->
i_buffer_pos
/
2
/
id
->
f_src
.
i_channels
;
aout_buf
.
i_nb_samples
=
id
->
i_buffer_pos
/
2
/
id
->
f_src
.
audio
.
i_channels
;
aout_buf
.
start_date
=
id
->
i_dts
;
aout_buf
.
start_date
=
id
->
i_dts
;
aout_buf
.
end_date
=
id
->
i_dts
;
aout_buf
.
end_date
=
id
->
i_dts
;
id
->
i_dts
+=
(
I64C
(
1000000
)
*
id
->
i_buffer_pos
/
2
/
id
->
i_dts
+=
(
I64C
(
1000000
)
*
id
->
i_buffer_pos
/
2
/
id
->
f_src
.
i_channels
/
id
->
f_src
.
i_sample
_rate
);
id
->
f_src
.
audio
.
i_channels
/
id
->
f_src
.
audio
.
i
_rate
);
p_block
=
id
->
p_encoder
->
pf_encode_audio
(
id
->
p_encoder
,
&
aout_buf
);
p_block
=
id
->
p_encoder
->
pf_encode_audio
(
id
->
p_encoder
,
&
aout_buf
);
while
(
p_block
)
while
(
p_block
)
...
@@ -919,26 +919,26 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -919,26 +919,26 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
int
i_ff_codec
;
int
i_ff_codec
;
/* Open decoder */
/* Open decoder */
if
(
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
)
||
if
(
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'2'
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'2'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'I'
,
'4'
,
'4'
,
'4'
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'I'
,
'4'
,
'4'
,
'4'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'R'
,
'V'
,
'1'
,
'5'
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'R'
,
'V'
,
'1'
,
'5'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'R'
,
'V'
,
'1'
,
'6'
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'R'
,
'V'
,
'1'
,
'6'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'R'
,
'V'
,
'2'
,
'4'
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'R'
,
'V'
,
'2'
,
'4'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'R'
,
'V'
,
'3'
,
'2'
)
||
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'R'
,
'V'
,
'3'
,
'2'
)
||
id
->
f_src
.
i_
fourc
c
==
VLC_FOURCC
(
'G'
,
'R'
,
'E'
,
'Y'
)
)
id
->
f_src
.
i_
code
c
==
VLC_FOURCC
(
'G'
,
'R'
,
'E'
,
'Y'
)
)
{
{
id
->
ff_dec
=
NULL
;
id
->
ff_dec
=
NULL
;
id
->
ff_dec_c
=
avcodec_alloc_context
();
id
->
ff_dec_c
=
avcodec_alloc_context
();
id
->
ff_dec_c
->
width
=
id
->
f_src
.
i_width
;
id
->
ff_dec_c
->
width
=
id
->
f_src
.
video
.
i_width
;
id
->
ff_dec_c
->
height
=
id
->
f_src
.
i_height
;
id
->
ff_dec_c
->
height
=
id
->
f_src
.
video
.
i_height
;
id
->
ff_dec_c
->
pix_fmt
=
get_ff_chroma
(
id
->
f_src
.
i_
fourc
c
);
id
->
ff_dec_c
->
pix_fmt
=
get_ff_chroma
(
id
->
f_src
.
i_
code
c
);
}
}
else
else
{
{
/* find decoder */
/* find decoder */
i_ff_codec
=
get_ff_codec
(
id
->
f_src
.
i_
fourc
c
);
i_ff_codec
=
get_ff_codec
(
id
->
f_src
.
i_
code
c
);
if
(
i_ff_codec
==
0
)
if
(
i_ff_codec
==
0
)
{
{
msg_Err
(
p_stream
,
"cannot find decoder"
);
msg_Err
(
p_stream
,
"cannot find decoder"
);
...
@@ -953,11 +953,11 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -953,11 +953,11 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
}
}
id
->
ff_dec_c
=
avcodec_alloc_context
();
id
->
ff_dec_c
=
avcodec_alloc_context
();
id
->
ff_dec_c
->
width
=
id
->
f_src
.
i_width
;
id
->
ff_dec_c
->
width
=
id
->
f_src
.
video
.
i_width
;
id
->
ff_dec_c
->
height
=
id
->
f_src
.
i_height
;
id
->
ff_dec_c
->
height
=
id
->
f_src
.
video
.
i_height
;
/* id->ff_dec_c->bit_rate = id->f_src.i_bitrate; */
/* id->ff_dec_c->bit_rate = id->f_src.i_bitrate; */
id
->
ff_dec_c
->
extradata_size
=
id
->
f_src
.
i_extra
_data
;
id
->
ff_dec_c
->
extradata_size
=
id
->
f_src
.
i_extra
;
id
->
ff_dec_c
->
extradata
=
id
->
f_src
.
p_extra
_data
;
id
->
ff_dec_c
->
extradata
=
id
->
f_src
.
p_extra
;
id
->
ff_dec_c
->
workaround_bugs
=
FF_BUG_AUTODETECT
;
id
->
ff_dec_c
->
workaround_bugs
=
FF_BUG_AUTODETECT
;
id
->
ff_dec_c
->
error_resilience
=
-
1
;
id
->
ff_dec_c
->
error_resilience
=
-
1
;
id
->
ff_dec_c
->
get_buffer
=
transcode_video_ffmpeg_getframebuf
;
id
->
ff_dec_c
->
get_buffer
=
transcode_video_ffmpeg_getframebuf
;
...
@@ -995,17 +995,17 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -995,17 +995,17 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
es_format_Init
(
&
id
->
p_encoder
->
fmt_in
,
es_format_Init
(
&
id
->
p_encoder
->
fmt_in
,
id
->
f_src
.
i_cat
,
get_vlc_chroma
(
id
->
ff_dec_c
->
pix_fmt
)
);
id
->
f_src
.
i_cat
,
get_vlc_chroma
(
id
->
ff_dec_c
->
pix_fmt
)
);
id
->
p_encoder
->
fmt_in
.
video
.
i_width
=
id
->
f_dst
.
i_width
;
id
->
p_encoder
->
fmt_in
.
video
.
i_width
=
id
->
f_dst
.
video
.
i_width
;
id
->
p_encoder
->
fmt_in
.
video
.
i_height
=
id
->
f_dst
.
i_height
;
id
->
p_encoder
->
fmt_in
.
video
.
i_height
=
id
->
f_dst
.
video
.
i_height
;
if
(
id
->
p_encoder
->
fmt_in
.
video
.
i_width
<=
0
)
if
(
id
->
p_encoder
->
fmt_in
.
video
.
i_width
<=
0
)
{
{
id
->
p_encoder
->
fmt_in
.
video
.
i_width
=
id
->
f_dst
.
i_width
=
id
->
p_encoder
->
fmt_in
.
video
.
i_width
=
id
->
f_dst
.
video
.
i_width
=
id
->
ff_dec_c
->
width
-
p_sys
->
i_crop_left
-
p_sys
->
i_crop_right
;
id
->
ff_dec_c
->
width
-
p_sys
->
i_crop_left
-
p_sys
->
i_crop_right
;
}
}
if
(
id
->
p_encoder
->
fmt_in
.
video
.
i_height
<=
0
)
if
(
id
->
p_encoder
->
fmt_in
.
video
.
i_height
<=
0
)
{
{
id
->
p_encoder
->
fmt_in
.
video
.
i_height
=
id
->
f_dst
.
i_height
=
id
->
p_encoder
->
fmt_in
.
video
.
i_height
=
id
->
f_dst
.
video
.
i_height
=
id
->
ff_dec_c
->
height
-
p_sys
->
i_crop_top
-
p_sys
->
i_crop_bottom
;
id
->
ff_dec_c
->
height
-
p_sys
->
i_crop_top
-
p_sys
->
i_crop_bottom
;
}
}
...
@@ -1031,7 +1031,7 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
...
@@ -1031,7 +1031,7 @@ static int transcode_video_ffmpeg_new( sout_stream_t *p_stream,
}
}
id
->
p_encoder
->
fmt_out
=
id
->
p_encoder
->
fmt_in
;
id
->
p_encoder
->
fmt_out
=
id
->
p_encoder
->
fmt_in
;
id
->
p_encoder
->
fmt_out
.
i_codec
=
id
->
f_dst
.
i_
fourc
c
;
id
->
p_encoder
->
fmt_out
.
i_codec
=
id
->
f_dst
.
i_
code
c
;
id
->
p_encoder
->
fmt_out
.
i_bitrate
=
id
->
f_dst
.
i_bitrate
;
id
->
p_encoder
->
fmt_out
.
i_bitrate
=
id
->
f_dst
.
i_bitrate
;
id
->
p_encoder
->
i_vtolerance
=
p_sys
->
i_vtolerance
;
id
->
p_encoder
->
i_vtolerance
=
p_sys
->
i_vtolerance
;
...
@@ -1179,14 +1179,14 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
...
@@ -1179,14 +1179,14 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
if
(
id
->
p_encoder
->
fmt_in
.
video
.
i_width
<=
0
)
if
(
id
->
p_encoder
->
fmt_in
.
video
.
i_width
<=
0
)
{
{
id
->
p_encoder
->
fmt_in
.
video
.
i_width
=
id
->
p_encoder
->
fmt_in
.
video
.
i_width
=
id
->
p_encoder
->
fmt_out
.
video
.
i_width
=
id
->
f_dst
.
i_width
=
id
->
p_encoder
->
fmt_out
.
video
.
i_width
=
id
->
f_dst
.
video
.
i_width
=
id
->
ff_dec_c
->
width
-
p_sys
->
i_crop_left
-
id
->
ff_dec_c
->
width
-
p_sys
->
i_crop_left
-
p_sys
->
i_crop_right
;
p_sys
->
i_crop_right
;
}
}
if
(
id
->
p_encoder
->
fmt_in
.
video
.
i_height
<=
0
)
if
(
id
->
p_encoder
->
fmt_in
.
video
.
i_height
<=
0
)
{
{
id
->
p_encoder
->
fmt_in
.
video
.
i_height
=
id
->
p_encoder
->
fmt_in
.
video
.
i_height
=
id
->
p_encoder
->
fmt_out
.
video
.
i_height
=
id
->
f_dst
.
i_height
=
id
->
p_encoder
->
fmt_out
.
video
.
i_height
=
id
->
f_dst
.
video
.
i_height
=
id
->
ff_dec_c
->
height
-
p_sys
->
i_crop_top
-
id
->
ff_dec_c
->
height
-
p_sys
->
i_crop_top
-
p_sys
->
i_crop_bottom
;
p_sys
->
i_crop_bottom
;
}
}
...
@@ -1203,14 +1203,14 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
...
@@ -1203,14 +1203,14 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
id
->
f_dst
.
i_extra
_data
=
id
->
p_encoder
->
fmt_out
.
i_extra
;
id
->
f_dst
.
i_extra
=
id
->
p_encoder
->
fmt_out
.
i_extra
;
id
->
f_dst
.
p_extra
_data
=
id
->
p_encoder
->
fmt_out
.
p_extra
;
id
->
f_dst
.
p_extra
=
id
->
p_encoder
->
fmt_out
.
p_extra
;
/* Hack for mp2v/mp1v transcoding support */
/* Hack for mp2v/mp1v transcoding support */
if
(
id
->
f_dst
.
i_
fourc
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'1'
,
'v'
)
||
if
(
id
->
f_dst
.
i_
code
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'1'
,
'v'
)
||
id
->
f_dst
.
i_
fourc
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'2'
,
'v'
)
)
id
->
f_dst
.
i_
code
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'2'
,
'v'
)
)
{
{
id
->
f_dst
.
i_
fourc
c
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
id
->
f_dst
.
i_
code
c
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
}
}
if
(
!
(
id
->
id
=
if
(
!
(
id
->
id
=
...
@@ -1293,8 +1293,8 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
...
@@ -1293,8 +1293,8 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
}
}
/* convert size and crop */
/* convert size and crop */
if
(
id
->
ff_dec_c
->
width
!=
id
->
f_dst
.
i_width
||
if
(
id
->
ff_dec_c
->
width
!=
id
->
f_dst
.
video
.
i_width
||
id
->
ff_dec_c
->
height
!=
id
->
f_dst
.
i_height
||
id
->
ff_dec_c
->
height
!=
id
->
f_dst
.
video
.
i_height
||
p_sys
->
i_crop_top
>
0
||
p_sys
->
i_crop_bottom
>
0
||
p_sys
->
i_crop_top
>
0
||
p_sys
->
i_crop_bottom
>
0
||
p_sys
->
i_crop_left
>
0
||
p_sys
->
i_crop_right
)
p_sys
->
i_crop_left
>
0
||
p_sys
->
i_crop_right
)
{
{
...
@@ -1304,18 +1304,18 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
...
@@ -1304,18 +1304,18 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
uint8_t
*
buf
;
uint8_t
*
buf
;
id
->
p_ff_pic_tmp2
=
avcodec_alloc_frame
();
id
->
p_ff_pic_tmp2
=
avcodec_alloc_frame
();
i_size
=
avpicture_get_size
(
id
->
i_inter_pixfmt
,
i_size
=
avpicture_get_size
(
id
->
i_inter_pixfmt
,
id
->
f_dst
.
i_width
,
id
->
f_dst
.
video
.
i_width
,
id
->
f_dst
.
i_height
);
id
->
f_dst
.
video
.
i_height
);
buf
=
malloc
(
i_size
);
buf
=
malloc
(
i_size
);
avpicture_fill
(
(
AVPicture
*
)
id
->
p_ff_pic_tmp2
,
buf
,
avpicture_fill
(
(
AVPicture
*
)
id
->
p_ff_pic_tmp2
,
buf
,
id
->
i_inter_pixfmt
,
id
->
i_inter_pixfmt
,
id
->
f_dst
.
i_width
,
id
->
f_dst
.
i_height
);
id
->
f_dst
.
video
.
i_width
,
id
->
f_dst
.
video
.
i_height
);
id
->
p_vresample
=
id
->
p_vresample
=
img_resample_full_init
(
id
->
f_dst
.
i_width
,
img_resample_full_init
(
id
->
f_dst
.
video
.
i_width
,
id
->
f_dst
.
i_height
,
id
->
f_dst
.
video
.
i_height
,
id
->
ff_dec_c
->
width
,
id
->
ff_dec_c
->
height
,
id
->
ff_dec_c
->
width
,
id
->
ff_dec_c
->
height
,
p_stream
->
p_sys
->
i_crop_top
,
p_stream
->
p_sys
->
i_crop_top
,
p_stream
->
p_sys
->
i_crop_bottom
,
p_stream
->
p_sys
->
i_crop_bottom
,
...
@@ -1332,9 +1332,9 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
...
@@ -1332,9 +1332,9 @@ static int transcode_video_ffmpeg_process( sout_stream_t *p_stream,
/* Encoding */
/* Encoding */
vout_InitPicture
(
VLC_OBJECT
(
p_stream
),
&
pic
,
vout_InitPicture
(
VLC_OBJECT
(
p_stream
),
&
pic
,
id
->
p_encoder
->
fmt_in
.
i_codec
,
id
->
p_encoder
->
fmt_in
.
i_codec
,
id
->
f_dst
.
i_width
,
id
->
f_dst
.
i_height
,
id
->
f_dst
.
video
.
i_width
,
id
->
f_dst
.
video
.
i_height
,
id
->
f_dst
.
i_width
*
VOUT_ASPECT_FACTOR
/
id
->
f_dst
.
video
.
i_width
*
VOUT_ASPECT_FACTOR
/
id
->
f_dst
.
i_height
);
id
->
f_dst
.
video
.
i_height
);
for
(
i_plane
=
0
;
i_plane
<
pic
.
i_planes
;
i_plane
++
)
for
(
i_plane
=
0
;
i_plane
<
pic
.
i_planes
;
i_plane
++
)
{
{
...
...
modules/stream_out/transrate/transrate.c
View file @
bfeea8d6
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright (C) 2003 Antoine Missout
* Copyright (C) 2003 Antoine Missout
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* $Id: transrate.c,v 1.
2 2003/11/12 18:13:31
fenrir Exp $
* $Id: transrate.c,v 1.
3 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
sout
_format_t
*
);
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
,
es
_format_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Del
(
sout_stream_t
*
,
sout_stream_id_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
static
int
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
@@ -212,7 +212,7 @@ struct sout_stream_id_t
...
@@ -212,7 +212,7 @@ struct sout_stream_id_t
};
};
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
sout
_format_t
*
p_fmt
)
static
sout_stream_id_t
*
Add
(
sout_stream_t
*
p_stream
,
es
_format_t
*
p_fmt
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_id_t
*
id
;
sout_stream_id_t
*
id
;
...
@@ -221,11 +221,11 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
...
@@ -221,11 +221,11 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
id
->
id
=
NULL
;
id
->
id
=
NULL
;
if
(
p_fmt
->
i_cat
==
VIDEO_ES
if
(
p_fmt
->
i_cat
==
VIDEO_ES
&&
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
)
)
&&
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
)
)
{
{
msg_Dbg
(
p_stream
,
msg_Dbg
(
p_stream
,
"creating video transrating for fcc=`%4.4s'"
,
"creating video transrating for fcc=`%4.4s'"
,
(
char
*
)
&
p_fmt
->
i_
fourc
c
);
(
char
*
)
&
p_fmt
->
i_
code
c
);
id
->
p_current_buffer
=
NULL
;
id
->
p_current_buffer
=
NULL
;
id
->
p_next_gop
=
NULL
;
id
->
p_next_gop
=
NULL
;
...
@@ -242,7 +242,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
...
@@ -242,7 +242,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
}
}
else
else
{
{
msg_Dbg
(
p_stream
,
"not transrating a stream (fcc=`%4.4s')"
,
(
char
*
)
&
p_fmt
->
i_
fourc
c
);
msg_Dbg
(
p_stream
,
"not transrating a stream (fcc=`%4.4s')"
,
(
char
*
)
&
p_fmt
->
i_
code
c
);
id
->
id
=
p_sys
->
p_out
->
pf_add
(
p_sys
->
p_out
,
p_fmt
);
id
->
id
=
p_sys
->
p_out
->
pf_add
(
p_sys
->
p_out
,
p_fmt
);
id
->
b_transrate
=
VLC_FALSE
;
id
->
b_transrate
=
VLC_FALSE
;
...
...
src/input/input_dec.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* input_dec.c: Functions for the management of decoders
* input_dec.c: Functions for the management of decoders
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_dec.c,v 1.7
1 2003/11/18 22:48:46
fenrir Exp $
* $Id: input_dec.c,v 1.7
2 2003/11/21 15:32:08
fenrir Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
* Gildas Bazin <gbazin@netcourrier.com>
...
@@ -303,11 +303,11 @@ struct decoder_owner_sys_t
...
@@ -303,11 +303,11 @@ struct decoder_owner_sys_t
vout_thread_t
*
p_vout
;
vout_thread_t
*
p_vout
;
sout_packetizer_input_t
*
p_sout
;
sout_packetizer_input_t
*
p_sout
;
sout_format_t
sout_format
;
/* Current format in use by the output */
/* Current format in use by the output */
video_format_t
video
;
video_format_t
video
;
audio_format_t
audio
;
audio_format_t
audio
;
es_format_t
sout
;
};
};
/*****************************************************************************
/*****************************************************************************
...
@@ -487,26 +487,10 @@ static int DecoderThread( decoder_t * p_dec )
...
@@ -487,26 +487,10 @@ static int DecoderThread( decoder_t * p_dec )
{
{
if
(
!
p_dec
->
p_owner
->
p_sout
)
if
(
!
p_dec
->
p_owner
->
p_sout
)
{
{
sout_format_t
*
p_format
=
&
p_dec
->
p_owner
->
sout_format
;
es_format_Copy
(
&
p_dec
->
p_owner
->
sout
,
&
p_dec
->
fmt_out
);
p_format
->
i_cat
=
p_dec
->
fmt_out
.
i_cat
;
p_format
->
i_fourcc
=
p_dec
->
fmt_out
.
i_codec
;
p_format
->
i_sample_rate
=
p_dec
->
fmt_out
.
audio
.
i_rate
;
p_format
->
i_channels
=
p_dec
->
fmt_out
.
audio
.
i_channels
;
p_format
->
i_block_align
=
p_dec
->
fmt_out
.
audio
.
i_blockalign
;
p_format
->
i_width
=
p_dec
->
fmt_out
.
video
.
i_width
;
p_format
->
i_height
=
p_dec
->
fmt_out
.
video
.
i_height
;
p_format
->
i_bitrate
=
p_dec
->
fmt_out
.
i_bitrate
;
p_format
->
i_extra_data
=
p_dec
->
fmt_out
.
i_extra
;
p_format
->
p_extra_data
=
p_dec
->
fmt_out
.
p_extra
;
p_dec
->
p_owner
->
p_sout
=
p_dec
->
p_owner
->
p_sout
=
sout_InputNew
(
p_dec
,
p_forma
t
);
sout_InputNew
(
p_dec
,
&
p_dec
->
p_owner
->
sou
t
);
if
(
p_dec
->
p_owner
->
p_sout
==
NULL
)
if
(
p_dec
->
p_owner
->
p_sout
==
NULL
)
{
{
...
...
src/stream_output/stream_output.c
View file @
bfeea8d6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* stream_output.c : stream output module
* stream_output.c : stream output module
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* Copyright (C) 2002 VideoLAN
* $Id: stream_output.c,v 1.3
4 2003/09/07 22:43:17
fenrir Exp $
* $Id: stream_output.c,v 1.3
5 2003/11/21 15:32:09
fenrir Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
...
@@ -175,7 +175,7 @@ void sout_DeleteInstance( sout_instance_t * p_sout )
...
@@ -175,7 +175,7 @@ void sout_DeleteInstance( sout_instance_t * p_sout )
* Packetizer/Input
* Packetizer/Input
*****************************************************************************/
*****************************************************************************/
sout_packetizer_input_t
*
__sout_InputNew
(
vlc_object_t
*
p_this
,
sout_packetizer_input_t
*
__sout_InputNew
(
vlc_object_t
*
p_this
,
sout
_format_t
*
p_fmt
)
es
_format_t
*
p_fmt
)
{
{
sout_instance_t
*
p_sout
=
NULL
;
sout_instance_t
*
p_sout
=
NULL
;
sout_packetizer_input_t
*
p_input
;
sout_packetizer_input_t
*
p_input
;
...
@@ -195,7 +195,7 @@ sout_packetizer_input_t *__sout_InputNew( vlc_object_t *p_this,
...
@@ -195,7 +195,7 @@ sout_packetizer_input_t *__sout_InputNew( vlc_object_t *p_this,
p_input
->
p_sout
=
p_sout
;
p_input
->
p_sout
=
p_sout
;
p_input
->
p_fmt
=
p_fmt
;
p_input
->
p_fmt
=
p_fmt
;
if
(
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'n'
,
'u'
,
'l'
,
'l'
)
)
if
(
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'n'
,
'u'
,
'l'
,
'l'
)
)
{
{
vlc_object_release
(
p_sout
);
vlc_object_release
(
p_sout
);
return
p_input
;
return
p_input
;
...
@@ -225,7 +225,7 @@ int sout_InputDelete( sout_packetizer_input_t *p_input )
...
@@ -225,7 +225,7 @@ int sout_InputDelete( sout_packetizer_input_t *p_input )
msg_Dbg
(
p_sout
,
"removing an input"
);
msg_Dbg
(
p_sout
,
"removing an input"
);
if
(
p_input
->
p_fmt
->
i_
fourc
c
!=
VLC_FOURCC
(
'n'
,
'u'
,
'l'
,
'l'
)
)
if
(
p_input
->
p_fmt
->
i_
code
c
!=
VLC_FOURCC
(
'n'
,
'u'
,
'l'
,
'l'
)
)
{
{
vlc_mutex_lock
(
&
p_sout
->
lock
);
vlc_mutex_lock
(
&
p_sout
->
lock
);
p_sout
->
p_stream
->
pf_del
(
p_sout
->
p_stream
,
p_input
->
id
);
p_sout
->
p_stream
->
pf_del
(
p_sout
->
p_stream
,
p_input
->
id
);
...
@@ -243,7 +243,7 @@ int sout_InputSendBuffer( sout_packetizer_input_t *p_input, sout_buffer_t *p_buf
...
@@ -243,7 +243,7 @@ int sout_InputSendBuffer( sout_packetizer_input_t *p_input, sout_buffer_t *p_buf
sout_instance_t
*
p_sout
=
p_input
->
p_sout
;
sout_instance_t
*
p_sout
=
p_input
->
p_sout
;
int
i_ret
;
int
i_ret
;
if
(
p_input
->
p_fmt
->
i_
fourc
c
==
VLC_FOURCC
(
'n'
,
'u'
,
'l'
,
'l'
)
)
if
(
p_input
->
p_fmt
->
i_
code
c
==
VLC_FOURCC
(
'n'
,
'u'
,
'l'
,
'l'
)
)
{
{
sout_BufferDelete
(
p_input
->
p_sout
,
p_buffer
);
sout_BufferDelete
(
p_input
->
p_sout
,
p_buffer
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -423,7 +423,7 @@ void sout_MuxDelete ( sout_mux_t *p_mux )
...
@@ -423,7 +423,7 @@ void sout_MuxDelete ( sout_mux_t *p_mux )
}
}
sout_input_t
*
sout_MuxAddStream
(
sout_mux_t
*
p_mux
,
sout_input_t
*
sout_MuxAddStream
(
sout_mux_t
*
p_mux
,
sout
_format_t
*
p_fmt
)
es
_format_t
*
p_fmt
)
{
{
sout_input_t
*
p_input
;
sout_input_t
*
p_input
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment