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
fab9512e
Commit
fab9512e
authored
Aug 11, 2005
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/codec/ffmpeg: ffmpeg's av_log() messages now go to our messages
bank instead of being fprintf'd to stderr.
parent
ca7e34b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
include/vlc_messages.h
include/vlc_messages.h
+1
-0
modules/codec/ffmpeg/encoder.c
modules/codec/ffmpeg/encoder.c
+2
-0
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/ffmpeg.c
+42
-0
No files found.
include/vlc_messages.h
View file @
fab9512e
...
...
@@ -105,6 +105,7 @@ struct msg_subscription_t
*****************************************************************************/
VLC_EXPORT
(
void
,
__msg_Generic
,
(
vlc_object_t
*
,
int
,
const
char
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
4
,
5
)
);
VLC_EXPORT
(
void
,
__msg_GenericVa
,
(
vlc_object_t
*
,
int
,
const
char
*
,
const
char
*
,
va_list
args
)
);
#define msg_GenericVa(a, b, c, d, e) __msg_GenericVa(VLC_OBJECT(a), b, c, d, e)
VLC_EXPORT
(
void
,
__msg_Info
,
(
vlc_object_t
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Err
,
(
vlc_object_t
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
void
,
__msg_Warn
,
(
vlc_object_t
*
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
...
...
modules/codec/ffmpeg/encoder.c
View file @
fab9512e
...
...
@@ -238,6 +238,8 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
p_sys
->
p_buffer
=
NULL
;
p_sys
->
p_context
=
p_context
=
avcodec_alloc_context
();
p_context
->
debug
=
config_GetInt
(
p_enc
,
"ffmpeg-debug"
);
p_context
->
opaque
=
(
void
*
)
p_this
;
/* Set CPU capabilities */
p_context
->
dsp_mask
=
0
;
...
...
modules/codec/ffmpeg/ffmpeg.c
View file @
fab9512e
...
...
@@ -240,6 +240,7 @@ static int OpenDecoder( vlc_object_t *p_this )
/* *** get a p_context *** */
p_context
=
avcodec_alloc_context
();
p_context
->
debug
=
config_GetInt
(
p_dec
,
"ffmpeg-debug"
);
p_context
->
opaque
=
(
void
*
)
p_this
;
/* Set CPU capabilities */
p_context
->
dsp_mask
=
0
;
...
...
@@ -325,6 +326,46 @@ static void CloseDecoder( vlc_object_t *p_this )
/*****************************************************************************
* local Functions
*****************************************************************************/
static
void
LibavcodecCallback
(
void
*
p_opaque
,
int
i_level
,
const
char
*
psz_format
,
va_list
va
)
{
int
i_vlc_level
;
AVCodecContext
*
p_avctx
=
(
AVCodecContext
*
)
p_opaque
;
AVClass
*
p_avc
;
vlc_object_t
*
p_this
;
char
*
psz_new_format
;
const
char
*
psz_item_name
;
if
(
p_avctx
==
NULL
||
p_avctx
->
opaque
==
NULL
)
return
;
p_this
=
(
vlc_object_t
*
)
p_avctx
->
opaque
;
p_avc
=
p_avctx
->
av_class
;
switch
(
i_level
)
{
case
AV_LOG_QUIET
:
i_vlc_level
=
VLC_MSG_ERR
;
break
;
case
AV_LOG_ERROR
:
i_vlc_level
=
VLC_MSG_WARN
;
break
;
case
AV_LOG_INFO
:
i_vlc_level
=
VLC_MSG_DBG
;
break
;
case
AV_LOG_DEBUG
:
default:
return
;
}
psz_item_name
=
p_avc
->
item_name
(
p_opaque
);
psz_new_format
=
malloc
(
strlen
(
psz_format
)
+
strlen
(
psz_item_name
)
+
16
+
7
);
sprintf
(
psz_new_format
,
"%s (%s@0x%p)"
,
psz_format
,
p_avc
->
item_name
(
p_opaque
),
p_opaque
);
msg_GenericVa
(
p_this
,
i_vlc_level
,
MODULE_STRING
,
psz_new_format
,
va
);
free
(
psz_new_format
);
}
void
E_
(
InitLibavcodec
)(
vlc_object_t
*
p_object
)
{
static
int
b_ffmpeginit
=
0
;
...
...
@@ -338,6 +379,7 @@ void E_(InitLibavcodec)( vlc_object_t *p_object )
{
avcodec_init
();
avcodec_register_all
();
av_log_set_callback
(
LibavcodecCallback
);
b_ffmpeginit
=
1
;
msg_Dbg
(
p_object
,
"libavcodec initialized (interface %d )"
,
...
...
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