Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
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
Expand all
Show 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 @@
* stream_output.h : stream output module
*****************************************************************************
* 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>
* Laurent Aimar <fenrir@via.ecp.fr>
...
...
@@ -27,6 +27,8 @@
* sout_instance_t: stream output thread descriptor
*****************************************************************************/
#include "vlc_es.h"
/*
* i_allocated_size: size of allocated buffer
* p_allocated_buffer: where data has been allocated
...
...
@@ -65,26 +67,6 @@ struct sout_buffer_t
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
{
vlc_mutex_t
lock
;
/* fifo data lock */
...
...
@@ -102,7 +84,7 @@ struct sout_input_t
{
sout_instance_t
*
p_sout
;
sout_format_t
*
p_fmt
;
es_format_t
*
p_fmt
;
sout_fifo_t
*
p_fifo
;
void
*
p_sys
;
...
...
@@ -114,7 +96,7 @@ struct sout_packetizer_input_t
sout_instance_t
*
p_sout
;
sout_format_t
*
p_fmt
;
es_format_t
*
p_fmt
;
sout_stream_id_t
*
id
;
};
...
...
@@ -225,7 +207,7 @@ struct sout_stream_t
char
*
psz_next
;
/* 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
*
);
/* manage a packet */
...
...
@@ -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 )
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_InputSendBuffer
,
(
sout_packetizer_input_t
*
,
sout_buffer_t
*
)
);
...
...
@@ -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
(
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_MuxDelete
,
(
sout_mux_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 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* 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>
* Vincent Seguin <seguin@via.ecp.fr>
...
...
@@ -217,6 +217,12 @@ typedef struct pgrm_sys_t pgrm_sys_t;
typedef
struct
stream_descriptor_t
stream_descriptor_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 */
typedef
struct
stream_t
stream_t
;
typedef
struct
es_out_t
es_out_t
;
...
...
@@ -230,7 +236,6 @@ typedef struct aout_sys_t aout_sys_t;
typedef
struct
aout_fifo_t
aout_fifo_t
;
typedef
struct
aout_input_t
aout_input_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
struct
audio_date_t
audio_date_t
;
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_sys_t
vout_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
struct
picture_t
picture_t
;
typedef
struct
picture_sys_t
picture_sys_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_stream_t
sout_stream_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 slp_session_t slp_session_t;*/
...
...
include/vlc_es.h
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* vlc_es.h
*****************************************************************************
* 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>
*
...
...
@@ -83,16 +83,16 @@ struct video_format_t
/**
* Description of subs
*/
typedef
struct
subs_format_t
struct
subs_format_t
{
char
*
psz_encoding
;
}
subs_format_t
;
};
/**
* ES definition
*/
typedef
struc
t
struct
es_format_
t
{
int
i_cat
;
vlc_fourcc_t
i_codec
;
...
...
@@ -116,7 +116,7 @@ typedef struct
int
i_extra
;
void
*
p_extra
;
}
es_format_t
;
};
static
inline
void
es_format_Init
(
es_format_t
*
fmt
,
int
i_cat
,
vlc_fourcc_t
i_codec
)
...
...
modules/mux/asf.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* asf.c
*****************************************************************************
* 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>
*
...
...
@@ -280,11 +280,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
{
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_extra
=
0
;
switch
(
p_input
->
p_fmt
->
i_
fourc
c
)
switch
(
p_input
->
p_fmt
->
i_
code
c
)
{
case
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
):
tk
->
i_tag
=
WAVE_FORMAT_A52
;
...
...
@@ -320,25 +320,25 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
case
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
):
tk
->
psz_name
=
"Raw audio 8bits"
;
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
;
break
;
case
VLC_FOURCC
(
's'
,
'1'
,
'6'
,
'l'
):
tk
->
psz_name
=
"Raw audio 16bits"
;
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
;
break
;
case
VLC_FOURCC
(
's'
,
'2'
,
'4'
,
'l'
):
tk
->
psz_name
=
"Raw audio 24bits"
;
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
;
break
;
case
VLC_FOURCC
(
's'
,
'3'
,
'2'
,
'l'
):
tk
->
psz_name
=
"Raw audio 32bits"
;
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
;
break
;
default:
...
...
@@ -347,20 +347,20 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
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
);
bo_init
(
&
bo
,
tk
->
p_extra
,
tk
->
i_extra
);
bo_addle_u16
(
&
bo
,
tk
->
i_tag
);
bo_addle_u16
(
&
bo
,
p_input
->
p_fmt
->
i_channels
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_sample
_rate
);
bo_addle_u16
(
&
bo
,
p_input
->
p_fmt
->
audio
.
i_channels
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
audio
.
i
_rate
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_bitrate
/
8
);
bo_addle_u16
(
&
bo
,
i_blockalign
);
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_add_mem
(
&
bo
,
p_input
->
p_fmt
->
p_extra
_data
,
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
,
p_input
->
p_fmt
->
i_extra
);
}
else
{
...
...
@@ -379,7 +379,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
msg_Dbg
(
p_mux
,
"adding mp2 header"
);
bo_addle_u16
(
&
bo
,
2
);
/* fwHeadLayer */
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
,
1
);
/* wHeadEmphasis */
bo_addle_u16
(
&
bo
,
16
);
/* fwHeadFlags */
...
...
@@ -401,46 +401,46 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
case
VIDEO_ES
:
{
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
);
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
->
i_height
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
video
.
i_width
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
video
.
i_height
);
bo_add_u8
(
&
bo
,
0x02
);
/* flags */
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
)
+
p_input
->
p_fmt
->
i_extra
_data
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_width
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
i_height
);
p_input
->
p_fmt
->
i_extra
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
video
.
i_width
);
bo_addle_u32
(
&
bo
,
p_input
->
p_fmt
->
video
.
i_height
);
bo_addle_u16
(
&
bo
,
1
);
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
->
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
->
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
->
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
->
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
->
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
->
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 )
else
{
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_addle_u32
(
&
bo
,
0
);
...
...
@@ -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
);
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
,
p_input
->
p_fmt
->
i_extra
_data
);
bo_add_mem
(
&
bo
,
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
);
}
if
(
p_input
->
p_fmt
->
i_bitrate
>
50000
)
...
...
modules/mux/avi.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* avi.c
*****************************************************************************
* 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>
*
...
...
@@ -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_wf
=
malloc
(
sizeof
(
WAVEFORMATEX
)
+
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
#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
)
{
memcpy
(
&
p_wf
[
1
],
p_input
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
);
}
p_wf
->
nChannels
=
p_input
->
p_fmt
->
i_channels
;
p_wf
->
nSamplesPerSec
=
p_input
->
p_fmt
->
i_sample
_rate
;
p_wf
->
nBlockAlign
=
p_input
->
p_fmt
->
i_block_
align
;
p_wf
->
nChannels
=
p_input
->
p_fmt
->
audio
.
i_channels
;
p_wf
->
nSamplesPerSec
=
p_input
->
p_fmt
->
audio
.
i
_rate
;
p_wf
->
nBlockAlign
=
p_input
->
p_fmt
->
audio
.
i_block
align
;
p_wf
->
nAvgBytesPerSec
=
p_input
->
p_fmt
->
i_bitrate
/
8
;
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'
,
' '
):
p_wf
->
wFormatTag
=
WAVE_FORMAT_A52
;
...
...
@@ -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_bih
=
malloc
(
sizeof
(
BITMAPINFOHEADER
)
+
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
i_extra
);
#define p_bih p_stream->p_bih
p_bih
->
biSize
=
sizeof
(
BITMAPINFOHEADER
)
+
p_input
->
p_fmt
->
i_extra
_data
;
if
(
p_input
->
p_fmt
->
i_extra
_data
>
0
)
p_input
->
p_fmt
->
i_extra
;
if
(
p_input
->
p_fmt
->
i_extra
>
0
)
{
memcpy
(
&
p_bih
[
1
],
p_input
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
);
}
p_bih
->
biWidth
=
p_input
->
p_fmt
->
i_width
;
p_bih
->
biHeight
=
p_input
->
p_fmt
->
i_height
;
p_bih
->
biWidth
=
p_input
->
p_fmt
->
video
.
i_width
;
p_bih
->
biHeight
=
p_input
->
p_fmt
->
video
.
i_height
;
p_bih
->
biPlanes
=
1
;
p_bih
->
biBitCount
=
24
;
p_bih
->
biSizeImage
=
0
;
...
...
@@ -353,13 +353,13 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_bih
->
biYPelsPerMeter
=
0
;
p_bih
->
biClrUsed
=
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'
):
p_bih
->
biCompression
=
VLC_FOURCC
(
'X'
,
'V'
,
'I'
,
'D'
);
break
;
default:
p_bih
->
biCompression
=
p_input
->
p_fmt
->
i_
fourc
c
;
p_bih
->
biCompression
=
p_input
->
p_fmt
->
i_
code
c
;
break
;
}
#undef p_bih
...
...
modules/mux/mp4.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* mp4.c: mp4/mov muxer
*****************************************************************************
* 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>
*
...
...
@@ -73,7 +73,7 @@ typedef struct
typedef
struct
{
sout_format_t
*
p_fmt
;
es_format_t
*
p_fmt
;
int
i_track_id
;
/* index */
...
...
@@ -209,10 +209,10 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
int
i_object_type_indication
;
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
=
GetDescrLength
(
p_stream
->
p_fmt
->
i_extra
_data
);
GetDescrLength
(
p_stream
->
p_fmt
->
i_extra
);
}
else
{
...
...
@@ -231,7 +231,7 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
/* DecoderConfigDescr */
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'
):
i_object_type_indication
=
0x20
;
...
...
@@ -246,7 +246,7 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
break
;
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
):
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
;
default:
i_object_type_indication
=
0x00
;
...
...
@@ -260,16 +260,16 @@ static bo_t *GetESDS( mp4_stream_t *p_stream )
bo_add_32be
(
esds
,
0x7fffffff
);
// maxBitrate
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
;
/* 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 )
}
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
{
...
...
@@ -480,8 +480,8 @@ static void Close( vlc_object_t * p_this )
}
else
{
bo_add_32be
(
tkhd
,
p_stream
->
p_fmt
->
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_width
<<
16
);
// width (presentation)
bo_add_32be
(
tkhd
,
p_stream
->
p_fmt
->
video
.
i_height
<<
16
);
// height(presentation)
}
box_fix
(
tkhd
);
box_gather
(
trak
,
tkhd
);
...
...
@@ -599,7 +599,7 @@ static void Close( vlc_object_t * p_this )
int
i
;
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'
):
memcpy
(
fcc
,
"mp4a"
,
4
);
...
...
@@ -615,7 +615,7 @@ static void Close( vlc_object_t * p_this )
break
;
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
;
break
;
}
...
...
@@ -631,11 +631,11 @@ static void Close( vlc_object_t * p_this )
bo_add_16be
(
soun
,
0
);
// version;
bo_add_16be
(
soun
,
0
);
// revision level (0)
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
,
-
2
);
// compression id
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
/* add an ES Descriptor */
...
...
@@ -659,7 +659,7 @@ static void Close( vlc_object_t * p_this )
int
i
;
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'
,
'g'
,
'v'
):
...
...
@@ -673,7 +673,7 @@ static void Close( vlc_object_t * p_this )
break
;
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
;
break
;
}
...
...
@@ -692,8 +692,8 @@ static void Close( vlc_object_t * p_this )
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
->
i_height
);
// i_height
bo_add_16be
(
vide
,
p_stream
->
p_fmt
->
video
.
i_width
);
// i_width
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
);
// v 72dpi
...
...
@@ -916,9 +916,9 @@ static void Close( vlc_object_t * p_this )
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
->
entry
);
...
...
@@ -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
;
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'
,
'v'
):
...
...
@@ -956,20 +956,20 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
break
;
default:
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
;
}
p_stream
=
malloc
(
sizeof
(
mp4_stream_t
)
);
p_stream
->
p_fmt
=
malloc
(
sizeof
(
sout
_format_t
)
);
memcpy
(
p_stream
->
p_fmt
,
p_input
->
p_fmt
,
sizeof
(
sout
_format_t
)
);
if
(
p_stream
->
p_fmt
->
i_extra
_data
)
{
p_stream
->
p_fmt
->
p_extra
_data
=
malloc
(
p_stream
->
p_fmt
->
i_extra
_data
);
memcpy
(
p_stream
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
i_extra
_data
);
p_stream
->
p_fmt
=
malloc
(
sizeof
(
es
_format_t
)
);
memcpy
(
p_stream
->
p_fmt
,
p_input
->
p_fmt
,
sizeof
(
es
_format_t
)
);
if
(
p_stream
->
p_fmt
->
i_extra
)
{
p_stream
->
p_fmt
->
p_extra
=
malloc
(
p_stream
->
p_fmt
->
i_extra
);
memcpy
(
p_stream
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
);
}
p_stream
->
i_track_id
=
p_sys
->
i_nb_streams
+
1
;
p_stream
->
i_entry_count
=
0
;
...
...
modules/mux/mpeg/ps.c
View file @
bfeea8d6
...
...
@@ -3,7 +3,7 @@
* multiplexer module for vlc
*****************************************************************************
* 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>
* Eric Petit <titer@videolan.org>
...
...
@@ -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
;
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
)
);
/* 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'
):
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 )
ps_stream_t
*
p_stream
=
(
ps_stream_t
*
)
p_input
->
p_sys
;
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'
):
StreamIdRelease
(
p_sys
->
stream_id_mpgv
,
0xe0
,
p_stream
->
i_stream_id
);
...
...
modules/mux/mpeg/ts.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* ts.c: MPEG-II TS Muxer
*****************************************************************************
* 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>
* Eric Petit <titer@videolan.org>
...
...
@@ -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
;
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
)
);
...
...
@@ -425,7 +425,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
switch
(
p_input
->
p_fmt
->
i_cat
)
{
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'
):
/* 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 )
case
VLC_FOURCC
(
'M'
,
'J'
,
'P'
,
'G'
):
p_stream
->
i_stream_type
=
0xa0
;
// private
p_stream
->
i_stream_id
=
0xa0
;
// beurk
p_stream
->
i_bih_codec
=
p_input
->
p_fmt
->
i_
fourc
c
;
p_stream
->
i_bih_width
=
p_input
->
p_fmt
->
i_width
;
p_stream
->
i_bih_height
=
p_input
->
p_fmt
->
i_height
;
p_stream
->
i_bih_codec
=
p_input
->
p_fmt
->
i_
code
c
;
p_stream
->
i_bih_width
=
p_input
->
p_fmt
->
video
.
i_width
;
p_stream
->
i_bih_height
=
p_input
->
p_fmt
->
video
.
i_height
;
break
;
default:
free
(
p_stream
);
...
...
@@ -463,10 +463,10 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
break
;
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'
):
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_sys
->
i_stream_id_mpga
++
;
break
;
...
...
@@ -488,7 +488,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
break
;
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'
,
' '
):
p_stream
->
i_stream_type
=
0x82
;
...
...
@@ -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 */
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
)
{
p_stream
->
p_decoder_specific_info
=
malloc
(
p_stream
->
i_decoder_specific_info
);
memcpy
(
p_stream
->
p_decoder_specific_info
,
p_input
->
p_fmt
->
p_extra
_data
,
p_input
->
p_fmt
->
i_extra
_data
);
p_input
->
p_fmt
->
p_extra
,
p_input
->
p_fmt
->
i_extra
);
}
/* Init pes chain */
...
...
modules/mux/ogg.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* ogg.c: ogg muxer module for vlc
*****************************************************************************
* 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>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -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_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_packet_no
=
0
;
...
...
@@ -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
);
SetWLE
(
&
p_stream
->
oggds_header
.
i_bits_per_sample
,
0
);
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
,
p_input
->
p_fmt
->
i_height
);
p_input
->
p_fmt
->
video
.
i_height
);
msg_Dbg
(
p_mux
,
"mp4v/div3 stream"
);
break
;
...
...
@@ -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_buffer_size
,
30
*
1024
);
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
);
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
,
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
);
msg_Dbg
(
p_mux
,
"mpga/a52 stream"
);
break
;
...
...
@@ -710,11 +710,11 @@ static sout_buffer_t *OggCreateHeader( sout_mux_t *p_mux, mtime_t i_dts )
/* Special case for mp4v */
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 */
op
.
bytes
=
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_extra
_data
;
op
.
packet
=
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
p_extra
_data
;
op
.
bytes
=
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
i_extra
;
op
.
packet
=
p_mux
->
pp_inputs
[
i
]
->
p_fmt
->
p_extra
;
op
.
b_o_s
=
0
;
op
.
e_o_s
=
0
;
op
.
granulepos
=
0
;
...
...
@@ -903,7 +903,7 @@ static int Mux( sout_mux_t *p_mux )
/* number of sample from begining + current packet */
op
.
granulepos
=
(
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
{
...
...
modules/packetizer/mpegvideo.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* mpegvideo.c
*****************************************************************************
* 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>
* Eric Petit <titer@videolan.org>
...
...
@@ -59,7 +59,7 @@ typedef struct packetizer_s
/* Output properties */
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_old_duration
;
...
...
@@ -173,12 +173,12 @@ static int InitThread( packetizer_t *p_pack )
{
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_width
=
0
;
p_pack
->
output_format
.
i_height
=
0
;
p_pack
->
output_format
.
i_
code
c
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
p_pack
->
output_format
.
video
.
i_width
=
0
;
p_pack
->
output_format
.
video
.
i_height
=
0
;
p_pack
->
output_format
.
i_bitrate
=
0
;
p_pack
->
output_format
.
i_extra
_data
=
0
;
p_pack
->
output_format
.
p_extra
_data
=
NULL
;
p_pack
->
output_format
.
i_extra
=
0
;
p_pack
->
output_format
.
p_extra
=
NULL
;
p_pack
->
b_expect_discontinuity
=
0
;
p_pack
->
p_sout_input
=
NULL
;
...
...
@@ -273,9 +273,9 @@ static void PacketizeThread( packetizer_t *p_pack )
GetChunk
(
&
p_pack
->
bit_stream
,
p_temp
,
4
);
i_pos
+=
4
;
/* 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 */
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 */
i_frame_rate_code
=
ShowBits
(
&
p_pack
->
bit_stream
,
32
)
&
0xF
;
...
...
@@ -327,8 +327,8 @@ static void PacketizeThread( packetizer_t *p_pack )
msg_Warn
(
p_pack
->
p_fifo
,
"creating input (image size %dx%d, frame rate %.2f)"
,
p_pack
->
output_format
.
i_width
,
p_pack
->
output_format
.
i_height
,
p_pack
->
output_format
.
video
.
i_width
,
p_pack
->
output_format
.
video
.
i_height
,
p_pack
->
d_frame_rate
);
/* now we have informations to create the input */
...
...
modules/stream_out/display.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* display.c
*****************************************************************************
* 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>
*
...
...
@@ -39,7 +39,7 @@
static
int
Open
(
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
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_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_id_t
*
id
;
...
...
@@ -155,37 +155,37 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
return
NULL
;
}
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
;
switch
(
p_fmt
->
i_cat
)
{
case
AUDIO_ES
:
id
->
p_es
->
p_bitmapinfoheader
=
NULL
;
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)
p_wf
->
wFormatTag
=
WAVE_FORMAT_UNKNOWN
;
p_wf
->
nChannels
=
p_fmt
->
i_channels
;
p_wf
->
nSamplesPerSec
=
p_fmt
->
i_sample
_rate
;
p_wf
->
nChannels
=
p_fmt
->
audio
.
i_channels
;
p_wf
->
nSamplesPerSec
=
p_fmt
->
audio
.
i
_rate
;
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
->
cbSize
=
p_fmt
->
i_extra
_data
;
if
(
p_fmt
->
i_extra
_data
>
0
)
p_wf
->
cbSize
=
p_fmt
->
i_extra
;
if
(
p_fmt
->
i_extra
>
0
)
{
memcpy
(
&
p_wf
[
1
],
p_fmt
->
p_extra
_data
,
p_fmt
->
i_extra
_data
);
p_fmt
->
p_extra
,
p_fmt
->
i_extra
);
}
#undef p_wf
break
;
case
VIDEO_ES
:
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)
p_bih
->
biSize
=
sizeof
(
BITMAPINFOHEADER
)
+
p_fmt
->
i_extra
_data
;
p_bih
->
biWidth
=
p_fmt
->
i_width
;
p_bih
->
biHeight
=
p_fmt
->
i_height
;
p_bih
->
biSize
=
sizeof
(
BITMAPINFOHEADER
)
+
p_fmt
->
i_extra
;
p_bih
->
biWidth
=
p_fmt
->
video
.
i_width
;
p_bih
->
biHeight
=
p_fmt
->
video
.
i_height
;
p_bih
->
biPlanes
=
0
;
p_bih
->
biBitCount
=
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
p_bih
->
biYPelsPerMeter
=
0
;
p_bih
->
biClrUsed
=
0
;
p_bih
->
biClrImportant
=
0
;
if
(
p_fmt
->
i_extra
_data
>
0
)
if
(
p_fmt
->
i_extra
>
0
)
{
memcpy
(
&
p_bih
[
1
],
p_fmt
->
p_extra
_data
,
p_fmt
->
i_extra
_data
);
p_fmt
->
p_extra
,
p_fmt
->
i_extra
);
}
#undef p_bih
break
;
...
...
modules/stream_out/dummy.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* dummy.c
*****************************************************************************
* 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>
*
...
...
@@ -36,7 +36,7 @@
static
int
Open
(
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
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_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
;
...
...
modules/stream_out/duplicate.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* duplicate.c
*****************************************************************************
* 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>
*
...
...
@@ -36,7 +36,7 @@
static
int
Open
(
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
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
...
@@ -134,7 +134,7 @@ static void Close( vlc_object_t * p_this )
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_id_t
*
id
;
...
...
modules/stream_out/es.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* es.c
*****************************************************************************
* 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>
*
...
...
@@ -38,7 +38,7 @@
static
int
Open
(
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
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
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_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
/* *** 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
)
{
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
)
{
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
{
...
...
@@ -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
;
}
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
++
;
...
...
modules/stream_out/gather.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* gather.c
*****************************************************************************
* 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>
*
...
...
@@ -46,7 +46,7 @@ vlc_module_end();
/*****************************************************************************
* 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
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_t
*
);
...
...
@@ -54,7 +54,7 @@ struct sout_stream_id_t
{
vlc_bool_t
b_used
;
sout
_format_t
fmt
;
es
_format_t
fmt
;
void
*
id
;
};
...
...
@@ -114,7 +114,7 @@ static void Close( vlc_object_t * p_this )
/*****************************************************************************
* 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_id_t
*
id
;
...
...
@@ -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
];
if
(
!
id
->
b_used
&&
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_sample_rate
==
p_fmt
->
i_sample
_rate
&&
id
->
fmt
.
i_channels
==
p_fmt
->
i_channels
&&
id
->
fmt
.
i_block_align
==
p_fmt
->
i_block_
align
)
||
id
->
fmt
.
audio
.
i_rate
==
p_fmt
->
audio
.
i
_rate
&&
id
->
fmt
.
audio
.
i_channels
==
p_fmt
->
audio
.
i_channels
&&
id
->
fmt
.
audio
.
i_blockalign
==
p_fmt
->
audio
.
i_block
align
)
||
(
id
->
fmt
.
i_cat
==
VIDEO_ES
&&
id
->
fmt
.
i_width
==
p_fmt
->
i_width
&&
id
->
fmt
.
i_height
==
p_fmt
->
i_height
)
)
)
id
->
fmt
.
video
.
i_width
==
p_fmt
->
video
.
i_width
&&
id
->
fmt
.
video
.
i_height
==
p_fmt
->
video
.
i_height
)
)
)
{
msg_Dbg
(
p_stream
,
"reusing already opened output"
);
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 )
id
=
malloc
(
sizeof
(
sout_stream_id_t
)
);
msg_Dbg
(
p_stream
,
"creating new output"
);
memcpy
(
&
id
->
fmt
,
p_fmt
,
sizeof
(
sout
_format_t
)
);
id
->
fmt
.
i_extra
_data
=
0
;
id
->
fmt
.
p_extra
_data
=
NULL
;
memcpy
(
&
id
->
fmt
,
p_fmt
,
sizeof
(
es
_format_t
)
);
id
->
fmt
.
i_extra
=
0
;
id
->
fmt
.
p_extra
=
NULL
;
id
->
b_used
=
VLC_TRUE
;
id
->
id
=
p_sys
->
p_out
->
pf_add
(
p_sys
->
p_out
,
p_fmt
);
if
(
id
->
id
==
NULL
)
...
...
modules/stream_out/rtp.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* rtp.c
*****************************************************************************
* 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>
*
...
...
@@ -49,7 +49,7 @@ vlc_module_end();
/*****************************************************************************
* 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
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 )
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_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
id
->
psz_destination
=
strdup
(
p_sys
->
psz_destination
);
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'
):
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
;
}
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
;
}
...
...
@@ -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
->
psz_rtpmap
=
malloc
(
strlen
(
"L16/*/*"
)
+
20
+
1
);
sprintf
(
id
->
psz_rtpmap
,
"L16/%d/%d"
,
p_fmt
->
i_sample_rate
,
p_fmt
->
i_channels
);
id
->
i_clock_rate
=
p_fmt
->
i_sample
_rate
;
sprintf
(
id
->
psz_rtpmap
,
"L16/%d/%d"
,
p_fmt
->
audio
.
i_rate
,
p_fmt
->
audio
.
i_channels
);
id
->
i_clock_rate
=
p_fmt
->
audio
.
i
_rate
;
id
->
pf_packetize
=
rtp_packetize_l16
;
break
;
case
VLC_FOURCC
(
'u'
,
'8'
,
' '
,
' '
):
id
->
i_payload_type
=
p_sys
->
i_payload_type
++
;
id
->
psz_rtpmap
=
malloc
(
strlen
(
"L8/*/*"
)
+
20
+
1
);
sprintf
(
id
->
psz_rtpmap
,
"L8/%d/%d"
,
p_fmt
->
i_sample_rate
,
p_fmt
->
i_channels
);
id
->
i_clock_rate
=
p_fmt
->
i_sample
_rate
;
sprintf
(
id
->
psz_rtpmap
,
"L8/%d/%d"
,
p_fmt
->
audio
.
i_rate
,
p_fmt
->
audio
.
i_channels
);
id
->
i_clock_rate
=
p_fmt
->
audio
.
i
_rate
;
id
->
pf_packetize
=
rtp_packetize_l8
;
break
;
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
break
;
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_clock_rate
=
90000
;
id
->
psz_rtpmap
=
strdup
(
"MP4V-ES/90000"
);
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
);
sprintf_hexa
(
hexa
,
p_fmt
->
p_extra
_data
,
p_fmt
->
i_extra_dat
a
);
id
->
psz_fmtp
=
malloc
(
100
+
2
*
p_fmt
->
i_extra
);
sprintf_hexa
(
hexa
,
p_fmt
->
p_extra
,
p_fmt
->
i_extr
a
);
sprintf
(
id
->
psz_fmtp
,
"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
}
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_clock_rate
=
p_fmt
->
i_sample
_rate
;
id
->
i_clock_rate
=
p_fmt
->
audio
.
i
_rate
;
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
->
psz_fmtp
=
malloc
(
200
+
2
*
p_fmt
->
i_extra
_data
);
sprintf_hexa
(
hexa
,
p_fmt
->
p_extra
_data
,
p_fmt
->
i_extra_dat
a
);
id
->
psz_fmtp
=
malloc
(
200
+
2
*
p_fmt
->
i_extra
);
sprintf_hexa
(
hexa
,
p_fmt
->
p_extra
,
p_fmt
->
i_extr
a
);
sprintf
(
id
->
psz_fmtp
,
"streamtype=5; profile-level-id=15; mode=AAC-hbr; config=%s; "
"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
}
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
);
return
NULL
;
}
...
...
modules/stream_out/standard.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* standard.c
*****************************************************************************
* 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>
*
...
...
@@ -40,7 +40,7 @@
static
int
Open
(
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
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_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_id_t
*
id
;
...
...
modules/stream_out/transcode.c
View file @
bfeea8d6
This diff is collapsed.
Click to expand it.
modules/stream_out/transrate/transrate.c
View file @
bfeea8d6
...
...
@@ -6,7 +6,7 @@
* Copyright (C) 2003 Antoine Missout
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
* 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>
* Laurent Aimar <fenrir@via.ecp.fr>
...
...
@@ -48,7 +48,7 @@
static
int
Open
(
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
Send
(
sout_stream_t
*
,
sout_stream_id_t
*
,
sout_buffer_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_id_t
*
id
;
...
...
@@ -221,11 +221,11 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
id
->
id
=
NULL
;
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
,
"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_next_gop
=
NULL
;
...
...
@@ -242,7 +242,7 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, sout_format_t *p_fmt )
}
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
->
b_transrate
=
VLC_FALSE
;
...
...
src/input/input_dec.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* 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>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -303,11 +303,11 @@ struct decoder_owner_sys_t
vout_thread_t
*
p_vout
;
sout_packetizer_input_t
*
p_sout
;
sout_format_t
sout_format
;
/* Current format in use by the output */
video_format_t
video
;
audio_format_t
audio
;
es_format_t
sout
;
};
/*****************************************************************************
...
...
@@ -487,26 +487,10 @@ static int DecoderThread( decoder_t * p_dec )
{
if
(
!
p_dec
->
p_owner
->
p_sout
)
{
sout_format_t
*
p_format
=
&
p_dec
->
p_owner
->
sout_format
;
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
;
es_format_Copy
(
&
p_dec
->
p_owner
->
sout
,
&
p_dec
->
fmt_out
);
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
)
{
...
...
src/stream_output/stream_output.c
View file @
bfeea8d6
...
...
@@ -2,7 +2,7 @@
* stream_output.c : stream output module
*****************************************************************************
* 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>
* Laurent Aimar <fenrir@via.ecp.fr>
...
...
@@ -175,7 +175,7 @@ void sout_DeleteInstance( sout_instance_t * p_sout )
* Packetizer/Input
*****************************************************************************/
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_packetizer_input_t
*
p_input
;
...
...
@@ -195,7 +195,7 @@ sout_packetizer_input_t *__sout_InputNew( vlc_object_t *p_this,
p_input
->
p_sout
=
p_sout
;
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
);
return
p_input
;
...
...
@@ -225,7 +225,7 @@ int sout_InputDelete( sout_packetizer_input_t *p_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
);
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
sout_instance_t
*
p_sout
=
p_input
->
p_sout
;
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
);
return
VLC_SUCCESS
;
...
...
@@ -423,7 +423,7 @@ void sout_MuxDelete ( 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
;
...
...
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