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
08fb37c0
Commit
08fb37c0
authored
Apr 15, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat (mux/demux): implement private options
parent
637db918
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
6 deletions
+37
-6
modules/codec/avcodec/avcommon.h
modules/codec/avcodec/avcommon.h
+1
-1
modules/demux/avformat/avformat.c
modules/demux/avformat/avformat.c
+3
-0
modules/demux/avformat/demux.c
modules/demux/avformat/demux.c
+21
-3
modules/demux/avformat/mux.c
modules/demux/avformat/mux.c
+12
-2
No files found.
modules/codec/avcodec/avcommon.h
View file @
08fb37c0
...
@@ -67,7 +67,7 @@ static inline void vlc_init_avcodec(void)
...
@@ -67,7 +67,7 @@ static inline void vlc_init_avcodec(void)
static
inline
AVDictionary
*
vlc_av_get_options
(
const
char
*
psz_opts
)
static
inline
AVDictionary
*
vlc_av_get_options
(
const
char
*
psz_opts
)
{
{
AVDictionary
*
options
=
NULL
;
AVDictionary
*
options
=
NULL
;
config_chain_t
*
cfg
;
config_chain_t
*
cfg
=
NULL
;
config_ChainParseOptions
(
&
cfg
,
psz_opts
);
config_ChainParseOptions
(
&
cfg
,
psz_opts
);
while
(
cfg
)
{
while
(
cfg
)
{
config_chain_t
*
next
=
cfg
->
p_next
;
config_chain_t
*
next
=
cfg
->
p_next
;
...
...
modules/demux/avformat/avformat.c
View file @
08fb37c0
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include <vlc_plugin.h>
#include <vlc_plugin.h>
#include "avformat.h"
#include "avformat.h"
#include "../../codec/avcodec/avcommon.h"
vlc_module_begin
()
vlc_module_begin
()
#endif
/* MERGE_FFMPEG */
#endif
/* MERGE_FFMPEG */
...
@@ -43,6 +44,7 @@ vlc_module_begin ()
...
@@ -43,6 +44,7 @@ vlc_module_begin ()
set_callbacks
(
OpenDemux
,
CloseDemux
)
set_callbacks
(
OpenDemux
,
CloseDemux
)
add_string
(
"avformat-format"
,
NULL
,
FORMAT_TEXT
,
FORMAT_LONGTEXT
,
true
)
add_string
(
"avformat-format"
,
NULL
,
FORMAT_TEXT
,
FORMAT_LONGTEXT
,
true
)
add_obsolete_string
(
"ffmpeg-format"
)
/* removed since 2.1.0 */
add_obsolete_string
(
"ffmpeg-format"
)
/* removed since 2.1.0 */
add_string
(
"avformat-options"
,
NULL
,
AV_OPTIONS_TEXT
,
AV_OPTIONS_LONGTEXT
,
true
)
#ifdef ENABLE_SOUT
#ifdef ENABLE_SOUT
/* mux submodule */
/* mux submodule */
...
@@ -52,6 +54,7 @@ vlc_module_begin ()
...
@@ -52,6 +54,7 @@ vlc_module_begin ()
set_capability
(
"sout mux"
,
2
)
set_capability
(
"sout mux"
,
2
)
add_string
(
"sout-avformat-mux"
,
NULL
,
MUX_TEXT
,
MUX_LONGTEXT
,
true
)
add_string
(
"sout-avformat-mux"
,
NULL
,
MUX_TEXT
,
MUX_LONGTEXT
,
true
)
add_obsolete_string
(
"ffmpeg-mux"
)
/* removed since 2.1.0 */
add_obsolete_string
(
"ffmpeg-mux"
)
/* removed since 2.1.0 */
add_string
(
"sout-avformat-options"
,
NULL
,
AV_OPTIONS_TEXT
,
AV_OPTIONS_LONGTEXT
,
true
)
set_callbacks
(
OpenMux
,
CloseMux
)
set_callbacks
(
OpenMux
,
CloseMux
)
#endif
#endif
#ifndef MERGE_FFMPEG
#ifndef MERGE_FFMPEG
...
...
modules/demux/avformat/demux.c
View file @
08fb37c0
...
@@ -250,13 +250,31 @@ int OpenDemux( vlc_object_t *p_this )
...
@@ -250,13 +250,31 @@ int OpenDemux( vlc_object_t *p_this )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
vlc_avcodec_lock
();
/* avformat calls avcodec behind our back!!! */
#if LIBAVFORMAT_VERSION_INT >= ((53<<16)+(26<<8)+0)
#if LIBAVFORMAT_VERSION_INT >= ((53<<16)+(26<<8)+0)
error
=
avformat_find_stream_info
(
p_sys
->
ic
,
NULL
/* options */
);
char
*
psz_opts
=
var_InheritString
(
p_demux
,
"avformat-options"
);
AVDictionary
*
options
[
p_sys
->
ic
->
nb_streams
];
if
(
psz_opts
&&
*
psz_opts
)
{
options
[
0
]
=
vlc_av_get_options
(
psz_opts
);
for
(
unsigned
i
=
1
;
i
<
p_sys
->
ic
->
nb_streams
;
i
++
)
{
options
[
i
]
=
NULL
;
av_dict_copy
(
&
options
[
i
],
options
[
0
],
0
);
}
}
free
(
psz_opts
);
vlc_avcodec_lock
();
/* avformat calls avcodec behind our back!!! */
error
=
avformat_find_stream_info
(
p_sys
->
ic
,
options
);
vlc_avcodec_unlock
();
AVDictionaryEntry
*
t
=
NULL
;
while
((
t
=
av_dict_get
(
options
,
""
,
t
,
AV_DICT_IGNORE_SUFFIX
)))
{
msg_Err
(
p_demux
,
"Unknown option
\"
%s
\"
"
,
t
->
key
);
}
av_dict_free
(
&
options
);
#else
#else
vlc_avcodec_lock
();
/* avformat calls avcodec behind our back!!! */
error
=
av_find_stream_info
(
p_sys
->
ic
);
error
=
av_find_stream_info
(
p_sys
->
ic
);
#endif
vlc_avcodec_unlock
();
vlc_avcodec_unlock
();
#endif
if
(
error
<
0
)
if
(
error
<
0
)
{
{
errno
=
AVUNERROR
(
error
);
errno
=
AVUNERROR
(
error
);
...
...
modules/demux/avformat/mux.c
View file @
08fb37c0
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
//#define AVFORMAT_DEBUG 1
//#define AVFORMAT_DEBUG 1
static
const
char
*
const
ppsz_mux_options
[]
=
{
static
const
char
*
const
ppsz_mux_options
[]
=
{
"mux"
,
NULL
"mux"
,
"options"
,
NULL
};
};
/*****************************************************************************
/*****************************************************************************
...
@@ -381,7 +381,17 @@ static int Mux( sout_mux_t *p_mux )
...
@@ -381,7 +381,17 @@ static int Mux( sout_mux_t *p_mux )
msg_Dbg
(
p_mux
,
"writing header"
);
msg_Dbg
(
p_mux
,
"writing header"
);
#if (LIBAVFORMAT_VERSION_INT >= ((53<<16)+(2<<8)+0))
#if (LIBAVFORMAT_VERSION_INT >= ((53<<16)+(2<<8)+0))
error
=
avformat_write_header
(
p_sys
->
oc
,
NULL
/* options */
);
char
*
psz_opts
=
var_GetNonEmptyString
(
p_mux
,
"sout-avformat-options"
);
AVDictionary
*
options
=
NULL
;
if
(
psz_opts
&&
*
psz_opts
)
options
=
vlc_av_get_options
(
psz_opts
);
free
(
psz_opts
);
error
=
avformat_write_header
(
p_sys
->
oc
,
options
?
&
options
:
NULL
);
AVDictionaryEntry
*
t
=
NULL
;
while
((
t
=
av_dict_get
(
options
,
""
,
t
,
AV_DICT_IGNORE_SUFFIX
)))
{
msg_Err
(
p_mux
,
"Unknown option
\"
%s
\"
"
,
t
->
key
);
}
av_dict_free
(
&
options
);
#else
#else
error
=
av_write_header
(
p_sys
->
oc
);
error
=
av_write_header
(
p_sys
->
oc
);
#endif
#endif
...
...
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