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
90a4caea
Commit
90a4caea
authored
Jul 19, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more demux and access code factorization
parent
5e2f8763
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
81 additions
and
226 deletions
+81
-226
include/vlc_access.h
include/vlc_access.h
+28
-0
include/vlc_demux.h
include/vlc_demux.h
+7
-1
modules/access/cdda.c
modules/access/cdda.c
+1
-12
modules/access/dv.c
modules/access/dv.c
+2
-10
modules/access/dvdnav.c
modules/access/dvdnav.c
+1
-4
modules/access/dvdread.c
modules/access/dvdread.c
+1
-4
modules/access/fake.c
modules/access/fake.c
+4
-15
modules/access/file.c
modules/access/file.c
+2
-15
modules/access/ftp.c
modules/access/ftp.c
+1
-12
modules/access/gnomevfs.c
modules/access/gnomevfs.c
+1
-14
modules/access/http.c
modules/access/http.c
+1
-12
modules/access/smb.c
modules/access/smb.c
+6
-16
modules/access/tcp.c
modules/access/tcp.c
+4
-11
modules/access/udp.c
modules/access/udp.c
+3
-12
modules/demux/a52.c
modules/demux/a52.c
+1
-6
modules/demux/dts.c
modules/demux/dts.c
+1
-5
modules/demux/mpeg/h264.c
modules/demux/mpeg/h264.c
+4
-22
modules/demux/mpeg/m4a.c
modules/demux/mpeg/m4a.c
+1
-2
modules/demux/mpeg/m4v.c
modules/demux/mpeg/m4v.c
+5
-22
modules/demux/mpeg/mpga.c
modules/demux/mpeg/mpga.c
+6
-29
modules/demux/mpeg/mpgv.c
modules/demux/mpeg/mpgv.c
+1
-2
No files found.
include/vlc_access.h
View file @
90a4caea
...
...
@@ -130,4 +130,32 @@ static inline int access2_Control( access_t *p_access, int i_query, ... )
return
i_result
;
}
static
void
inline
access_InitFields
(
access_t
*
p_a
)
{
p_a
->
info
.
i_update
=
0
;
p_a
->
info
.
i_size
=
0
;
p_a
->
info
.
i_pos
=
0
;
p_a
->
info
.
b_eof
=
VLC_FALSE
;
p_a
->
info
.
i_title
=
0
;
p_a
->
info
.
i_seekpoint
=
0
;
}
#define ACCESS_SET_CALLBACKS( read, block, control, seek ) \
p_access->pf_read = read; \
p_access->pf_block = block; \
p_access->pf_control = control; \
p_access->pf_seek = seek; \
#define STANDARD_READ_ACCESS_INIT \
access_InitFields( p_access ); \
ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek ); \
MALLOC_ERR( p_access->p_sys, access_sys_t ); \
p_sys = p_access->p_sys; memset( p_sys, 0, sizeof( access_sys_t ) );
#define STANDARD_BLOCK_ACCESS_INIT \
access_InitFields( p_access ); \
ACCESS_SET_CALLBACKS( NULL, Block, Control, Seek ); \
MALLOC_ERR( p_access->p_sys, access_sys_t ); \
p_sys = p_access->p_sys; memset( p_sys, 0, sizeof( access_sys_t ) );
#endif
include/vlc_demux.h
View file @
90a4caea
...
...
@@ -155,12 +155,14 @@ static inline vlc_bool_t isDemux( demux_t *p_demux, char *psz_requested )
#define STANDARD_DEMUX_INIT \
p_demux->pf_control = Control; \
p_demux->pf_demux = Demux; \
MALLOC_ERR( p_demux->p_sys, demux_sys_t );
MALLOC_ERR( p_demux->p_sys, demux_sys_t ); \
memset( p_demux->p_sys, 0, sizeof( demux_sys_t ) );
#define STANDARD_DEMUX_INIT_MSG( msg ) \
p_demux->pf_control = Control; \
p_demux->pf_demux = Demux; \
MALLOC_ERR( p_demux->p_sys, demux_sys_t ); \
memset( p_demux->p_sys, 0, sizeof( demux_sys_t ) ); \
msg_Dbg( p_demux, msg ); \
#define DEMUX_BY_EXTENSION( ext ) \
...
...
@@ -229,6 +231,10 @@ static inline vlc_bool_t isDemux( demux_t *p_demux, char *psz_requested )
return VLC_EGENERIC; \
}
#define DESTROY_PACKETIZER( location ) \
if( location->p_module ) module_Unneed( location, location->p_module ); \
vlc_object_destroy( location );
/**
* @}
*/
...
...
modules/access/cdda.c
View file @
90a4caea
...
...
@@ -174,18 +174,7 @@ static int Open( vlc_object_t *p_this )
free
(
psz_name
);
/* Set up p_access */
p_access
->
pf_read
=
NULL
;
p_access
->
pf_block
=
Block
;
p_access
->
pf_control
=
Control
;
p_access
->
pf_seek
=
Seek
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
STANDARD_BLOCK_ACCESS_INIT
p_sys
->
vcddev
=
vcddev
;
/* We only do separate items if the whole disc is requested -
...
...
modules/access/dv.c
View file @
90a4caea
...
...
@@ -142,17 +142,9 @@ static int Open( vlc_object_t *p_this )
msg_Dbg
(
p_access
,
"opening device %s"
,
psz_name
);
/* Set up p_access */
p_access
->
pf_read
=
NULL
;
p_access
->
pf_block
=
Block
;
p_access
->
pf_control
=
Control
;
p_access
->
pf_seek
=
NULL
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
access_InitFields
(
p_access
);
ACCESS_SET_CALLBACKS
(
NULL
,
Block
,
Control
,
NULL
);
p_access
->
info
.
b_prebuffered
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
...
...
modules/access/dvdnav.c
View file @
90a4caea
...
...
@@ -206,10 +206,7 @@ static int Open( vlc_object_t *p_this )
free
(
psz_name
);
/* Fill p_demux field */
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
STANDARD_DEMUX_INIT
;
p_sys
=
p_demux
->
p_sys
;
p_sys
->
dvdnav
=
p_dvdnav
;
ps_track_init
(
p_sys
->
tk
);
...
...
modules/access/dvdread.c
View file @
90a4caea
...
...
@@ -246,10 +246,7 @@ static int Open( vlc_object_t *p_this )
msg_Dbg
(
p_demux
,
"VMG opened"
);
/* Fill p_demux field */
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
STANDARD_DEMUX_INIT
;
p_sys
=
p_demux
->
p_sys
;
ps_track_init
(
p_sys
->
tk
);
p_sys
->
i_aspect
=
-
1
;
...
...
modules/access/fake.c
View file @
90a4caea
...
...
@@ -92,7 +92,6 @@ static int Open( vlc_object_t *p_this )
{
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
;
vlc_value_t
val
;
es_format_t
fmt
;
/* Only when selected */
...
...
@@ -100,27 +99,17 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
/* Set up p_demux */
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
STANDARD_DEMUX_INIT
;
p_sys
=
p_demux
->
p_sys
;
p_demux
->
info
.
i_update
=
0
;
p_demux
->
info
.
i_title
=
0
;
p_demux
->
info
.
i_seekpoint
=
0
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
var_Create
(
p_demux
,
"fake-duration"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_demux
,
"fake-duration"
,
&
val
);
p_sys
->
i_duration
=
val
.
i_int
*
1000
;
var_Create
(
p_demux
,
"fake-fps"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_demux
,
"fake-fps"
,
&
val
);
p_sys
->
f_fps
=
val
.
f_float
;
p_sys
->
i_duration
=
var_CreateGetInteger
(
p_demux
,
"fake-duration"
)
*
1000
;
p_sys
->
f_fps
=
var_CreateGetFloat
(
p_demux
,
"fake-fps"
);
/* Declare the elementary stream */
es_format_Init
(
&
fmt
,
VIDEO_ES
,
VLC_FOURCC
(
'f'
,
'a'
,
'k'
,
'e'
)
);
var_Create
(
p_demux
,
"fake-id"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_demux
,
"fake-id"
,
&
val
);
fmt
.
i_id
=
val
.
i_int
;
fmt
.
i_id
=
var_CreateGetInteger
(
p_demux
,
"fake-id"
);
p_sys
->
p_es_video
=
es_out_Add
(
p_demux
->
out
,
&
fmt
);
/* Update default_pts to a suitable value for access */
...
...
modules/access/file.c
View file @
90a4caea
...
...
@@ -153,11 +153,8 @@ static int Open( vlc_object_t *p_this )
#ifdef HAVE_SYS_STAT_H
struct
stat
stat_info
;
#endif
vlc_bool_t
b_stdin
;
file_entry_t
*
p_file
;
b_stdin
=
psz_name
[
0
]
==
'-'
&&
psz_name
[
1
]
==
'\0'
;
vlc_bool_t
b_stdin
=
psz_name
[
0
]
==
'-'
&&
psz_name
[
1
]
==
'\0'
;
if
(
!
b_stdin
)
{
...
...
@@ -192,17 +189,7 @@ static int Open( vlc_object_t *p_this )
#endif
}
p_access
->
pf_read
=
Read
;
p_access
->
pf_block
=
NULL
;
p_access
->
pf_seek
=
Seek
;
p_access
->
pf_control
=
Control
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
STANDARD_READ_ACCESS_INIT
;
p_sys
->
i_nb_reads
=
0
;
p_sys
->
b_kfir
=
VLC_FALSE
;
p_sys
->
file
=
NULL
;
...
...
modules/access/ftp.c
View file @
90a4caea
...
...
@@ -207,18 +207,7 @@ static int Open( vlc_object_t *p_this )
char
*
psz_arg
;
/* Init p_access */
p_access
->
pf_read
=
Read
;
p_access
->
pf_block
=
NULL
;
p_access
->
pf_seek
=
Seek
;
p_access
->
pf_control
=
Control
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
STANDARD_READ_ACCESS_INIT
p_sys
->
fd_cmd
=
-
1
;
p_sys
->
fd_data
=
-
1
;
...
...
modules/access/gnomevfs.c
View file @
90a4caea
...
...
@@ -104,20 +104,7 @@ static int Open( vlc_object_t *p_this )
open a file with a valid protocol, try to open at least file:// */
gnome_vfs_open
(
&
p_handle
,
"file://"
,
5
);
p_access
->
pf_read
=
Read
;
p_access
->
pf_block
=
NULL
;
p_access
->
pf_seek
=
Seek
;
p_access
->
pf_control
=
Control
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
STANDARD_READ_ACCESS_INIT
;
p_sys
->
p_handle
=
p_handle
;
p_sys
->
i_nb_reads
=
0
;
...
...
modules/access/http.c
View file @
90a4caea
...
...
@@ -161,18 +161,7 @@ static int Open( vlc_object_t *p_this )
char
*
psz
,
*
p
;
/* Set up p_access */
p_access
->
pf_read
=
Read
;
p_access
->
pf_block
=
NULL
;
p_access
->
pf_control
=
Control
;
p_access
->
pf_seek
=
Seek
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
STANDARD_READ_ACCESS_INIT
;
p_sys
->
fd
=
-
1
;
p_sys
->
b_proxy
=
VLC_FALSE
;
p_sys
->
i_version
=
1
;
...
...
modules/access/smb.c
View file @
90a4caea
...
...
@@ -235,11 +235,12 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
p_access
->
info
.
i_size
=
0
;
/* Init p_access */
STANDARD_READ_ACCESS_INIT
;
i_ret
=
p_smb
->
fstat
(
p_smb
,
p_file
,
&
filestat
);
if
(
i_ret
)
msg_Err
(
p_access
,
"stat failed (%s)"
,
strerror
(
errno
)
);
else
p_access
->
info
.
i_size
=
filestat
.
st_size
;
#else
#ifndef WIN32
...
...
@@ -258,7 +259,9 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
p_access
->
info
.
i_size
=
0
;
/* Init p_access */
STANDARD_READ_ACCESS_INIT
;
i_ret
=
smbc_fstat
(
i_smb
,
&
filestat
);
if
(
i_ret
)
msg_Err
(
p_access
,
"stat failed (%s)"
,
strerror
(
i_ret
)
);
else
p_access
->
info
.
i_size
=
filestat
.
st_size
;
...
...
@@ -266,19 +269,6 @@ static int Open( vlc_object_t *p_this )
free
(
psz_uri
);
/* Init p_access */
p_access
->
pf_read
=
Read
;
p_access
->
pf_block
=
NULL
;
p_access
->
pf_seek
=
Seek
;
p_access
->
pf_control
=
Control
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
#ifdef USE_CTX
p_sys
->
p_smb
=
p_smb
;
p_sys
->
p_file
=
p_file
;
...
...
modules/access/tcp.c
View file @
90a4caea
...
...
@@ -98,17 +98,10 @@ static int Open( vlc_object_t *p_this )
*
psz_parser
++
=
'\0'
;
/* Init p_access */
p_access
->
pf_read
=
Read
;
p_access
->
pf_block
=
NULL
;
p_access
->
pf_control
=
Control
;
p_access
->
pf_seek
=
NULL
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
access_InitFields
(
p_access
);
\
ACCESS_SET_CALLBACKS
(
Read
,
NULL
,
Control
,
NULL
);
\
MALLOC_ERR
(
p_access
->
p_sys
,
access_sys_t
);
\
p_sys
=
p_access
->
p_sys
;
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
p_sys
->
fd
=
net_ConnectTCP
(
p_access
,
psz_dup
,
atoi
(
psz_parser
)
);
free
(
psz_dup
);
...
...
modules/access/udp.c
View file @
90a4caea
...
...
@@ -190,19 +190,11 @@ static int Open( vlc_object_t *p_this )
psz_server_addr
,
i_server_port
,
psz_bind_addr
,
i_bind_port
);
/* Set up p_access */
p_access
->
pf_read
=
NULL
;
p_access
->
pf_block
=
BlockChoose
;
p_access
->
pf_control
=
Control
;
p_access
->
pf_seek
=
NULL
;
p_access
->
info
.
i_update
=
0
;
p_access
->
info
.
i_size
=
0
;
p_access
->
info
.
i_pos
=
0
;
p_access
->
info
.
b_eof
=
VLC_FALSE
;
access_InitFields
(
p_access
);
ACCESS_SET_CALLBACKS
(
NULL
,
BlockChoose
,
Control
,
NULL
);
p_access
->
info
.
b_prebuffered
=
VLC_FALSE
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
MALLOC_ERR
(
p_access
->
p_sys
,
access_sys_t
);
p_sys
=
p_access
->
p_sys
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
p_sys
->
fd
=
net_OpenUDP
(
p_access
,
psz_bind_addr
,
i_bind_port
,
psz_server_addr
,
i_server_port
);
if
(
p_sys
->
fd
<
0
)
...
...
@@ -226,7 +218,6 @@ static int Open( vlc_object_t *p_this )
/* Update default_pts to a suitable value for udp access */
var_Create
(
p_access
,
"udp-caching"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
/* RTP reordering for out-of-sequence packets */
p_sys
->
i_rtp_late
=
var_CreateGetInteger
(
p_access
,
"rtp-late"
)
*
1000
;
p_sys
->
i_last_seqno
=
0
;
...
...
modules/demux/a52.c
View file @
90a4caea
...
...
@@ -163,12 +163,7 @@ static void Close( vlc_object_t * p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
/* Unneed module */
module_Unneed
(
p_sys
->
p_packetizer
,
p_sys
->
p_packetizer
->
p_module
);
/* Delete the decoder */
vlc_object_destroy
(
p_sys
->
p_packetizer
);
DESTROY_PACKETIZER
(
p_sys
->
p_packetizer
);
free
(
p_sys
);
}
...
...
modules/demux/dts.c
View file @
90a4caea
...
...
@@ -167,11 +167,7 @@ static void Close( vlc_object_t *p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
/* Unneed module */
module_Unneed
(
p_sys
->
p_packetizer
,
p_sys
->
p_packetizer
->
p_module
);
/* Delete the decoder */
vlc_object_destroy
(
p_sys
->
p_packetizer
);
DESTROY_PACKETIZER
(
p_sys
->
p_packetizer
);
free
(
p_sys
);
}
...
...
modules/demux/mpeg/h264.c
View file @
90a4caea
...
...
@@ -118,27 +118,10 @@ static int Open( vlc_object_t * p_this )
}
msg_Dbg
(
p_demux
,
"using %.2f fps"
,
p_sys
->
f_fps
);
/*
* Load the mpegvideo packetizer
*/
p_sys
->
p_packetizer
=
vlc_object_create
(
p_demux
,
VLC_OBJECT_PACKETIZER
);
p_sys
->
p_packetizer
->
pf_decode_audio
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_video
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_sub
=
NULL
;
p_sys
->
p_packetizer
->
pf_packetize
=
NULL
;
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_in
,
VIDEO_ES
,
VLC_FOURCC
(
'h'
,
'2'
,
'6'
,
'4'
)
);
/* Load the mpegvideo packetizer */
INIT_VPACKETIZER
(
p_sys
->
p_packetizer
,
'h'
,
'2'
,
'6'
,
'4'
);
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_out
,
UNKNOWN_ES
,
0
);
p_sys
->
p_packetizer
->
p_module
=
module_Need
(
p_sys
->
p_packetizer
,
"packetizer"
,
NULL
,
0
);
if
(
p_sys
->
p_packetizer
->
p_module
==
NULL
)
{
vlc_object_destroy
(
p_sys
->
p_packetizer
);
msg_Err
(
p_demux
,
"cannot find mp4v packetizer"
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
LOAD_PACKETIZER_OR_FAIL
(
p_sys
->
p_packetizer
,
"H264"
);
return
VLC_SUCCESS
;
}
...
...
@@ -151,8 +134,7 @@ static void Close( vlc_object_t * p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
module_Unneed
(
p_sys
->
p_packetizer
,
p_sys
->
p_packetizer
->
p_module
);
vlc_object_destroy
(
p_sys
->
p_packetizer
);
DESTROY_PACKETIZER
(
p_sys
->
p_packetizer
);
free
(
p_sys
);
}
...
...
modules/demux/mpeg/m4a.c
View file @
90a4caea
...
...
@@ -122,8 +122,7 @@ static void Close( vlc_object_t * p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
module_Unneed
(
p_sys
->
p_packetizer
,
p_sys
->
p_packetizer
->
p_module
);
vlc_object_destroy
(
p_sys
->
p_packetizer
);
DESTROY_PACKETIZER
(
p_sys
->
p_packetizer
);
free
(
p_sys
);
}
...
...
modules/demux/mpeg/m4v.c
View file @
90a4caea
...
...
@@ -104,27 +104,11 @@ static int Open( vlc_object_t * p_this )
p_sys
->
p_es
=
NULL
;
p_sys
->
i_dts
=
1
;
/*
* Load the mpegvideo packetizer
*/
p_sys
->
p_packetizer
=
vlc_object_create
(
p_demux
,
VLC_OBJECT_PACKETIZER
);
p_sys
->
p_packetizer
->
pf_decode_audio
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_video
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_sub
=
NULL
;
p_sys
->
p_packetizer
->
pf_packetize
=
NULL
;
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_in
,
VIDEO_ES
,
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
)
);
/* Load the mpeg4video packetizer */
INIT_VPACKETIZER
(
p_sys
->
p_packetizer
,
'm'
,
'p'
,
'4'
,
'v'
);
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_out
,
UNKNOWN_ES
,
0
);
p_sys
->
p_packetizer
->
p_module
=
module_Need
(
p_sys
->
p_packetizer
,
"packetizer"
,
NULL
,
0
);
if
(
p_sys
->
p_packetizer
->
p_module
==
NULL
)
{
vlc_object_destroy
(
p_sys
->
p_packetizer
);
msg_Err
(
p_demux
,
"cannot find mp4v packetizer"
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
LOAD_PACKETIZER_OR_FAIL
(
p_sys
->
p_packetizer
,
"mpeg4 video"
);
/* We need to wait until we gtt p_extra (VOL header) from the packetizer
* before we create the output */
...
...
@@ -140,8 +124,7 @@ static void Close( vlc_object_t * p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
module_Unneed
(
p_sys
->
p_packetizer
,
p_sys
->
p_packetizer
->
p_module
);
vlc_object_destroy
(
p_sys
->
p_packetizer
);
DESTROY_PACKETIZER
(
p_sys
->
p_packetizer
)
;
free
(
p_sys
);
}
...
...
modules/demux/mpeg/mpga.c
View file @
90a4caea
...
...
@@ -157,35 +157,16 @@ static int Open( vlc_object_t * p_this )
if
(
!
b_ok
&&
!
p_demux
->
b_force
)
return
VLC_EGENERIC
;
}
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
)
;
STANDARD_DEMUX_INIT
;
p_sys
=
p_demux
->
p_sys
;
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
p_sys
->
p_es
=
0
;
p_sys
->
p_packetizer
=
0
;
p_sys
->
b_start
=
VLC_TRUE
;
p_sys
->
meta
=
0
;
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
/*
* Load the mpeg audio packetizer
*/
p_sys
->
p_packetizer
=
vlc_object_create
(
p_demux
,
VLC_OBJECT_PACKETIZER
);
p_sys
->
p_packetizer
->
pf_decode_audio
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_video
=
NULL
;
p_sys
->
p_packetizer
->
pf_decode_sub
=
NULL
;
p_sys
->
p_packetizer
->
pf_packetize
=
NULL
;
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_in
,
AUDIO_ES
,
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
)
);
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_out
,
UNKNOWN_ES
,
0
);
p_sys
->
p_packetizer
->
p_module
=
module_Need
(
p_sys
->
p_packetizer
,
"packetizer"
,
NULL
,
0
);
if
(
p_sys
->
p_packetizer
->
p_module
==
NULL
)
{
msg_Err
(
p_demux
,
"cannot find mpga packetizer"
);
Close
(
VLC_OBJECT
(
p_demux
)
);
return
VLC_EGENERIC
;
}
/* Load the mpeg audio packetizer */
INIT_APACKETIZER
(
p_sys
->
p_packetizer
,
'm'
,
'p'
,
'g'
,
'a'
);
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_out
,
UNKNOWN_ES
,
0
);
LOAD_PACKETIZER_OR_FAIL
(
p_sys
->
p_packetizer
,
"mpga"
);
/* Xing header */
if
(
HeaderCheck
(
header
)
)
...
...
@@ -354,13 +335,9 @@ static void Close( vlc_object_t * p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
DESTROY_PACKETIZER
(
p_sys
->
p_packetizer
);
if
(
p_sys
->
meta
)
vlc_meta_Delete
(
p_sys
->
meta
);
if
(
p_sys
->
p_packetizer
&&
p_sys
->
p_packetizer
->
p_module
)
module_Unneed
(
p_sys
->
p_packetizer
,
p_sys
->
p_packetizer
->
p_module
);
if
(
p_sys
->
p_packetizer
)
vlc_object_destroy
(
p_sys
->
p_packetizer
);
free
(
p_sys
);
}
...
...
modules/demux/mpeg/mpgv.c
View file @
90a4caea
...
...
@@ -125,8 +125,7 @@ static void Close( vlc_object_t * p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
module_Unneed
(
p_sys
->
p_packetizer
,
p_sys
->
p_packetizer
->
p_module
);
vlc_object_destroy
(
p_sys
->
p_packetizer
);
DESTROY_PACKETIZER
(
p_sys
->
p_packetizer
);
free
(
p_sys
);
}
...
...
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