Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e14437f3
Commit
e14437f3
authored
Sep 26, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/codec/ffmpeg/*: some chroma conversion routines require libavcodec to be initialised.
parent
d5e8b5bb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
34 deletions
+44
-34
modules/codec/ffmpeg/chroma.c
modules/codec/ffmpeg/chroma.c
+8
-4
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/ffmpeg.c
+36
-30
No files found.
modules/codec/ffmpeg/chroma.c
View file @
e14437f3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* chroma.c: chroma conversion using ffmpeg library
* chroma.c: chroma conversion using ffmpeg library
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: chroma.c,v 1.
1 2003/04/27 15:25:11
gbazin Exp $
* $Id: chroma.c,v 1.
2 2003/09/26 16:10:24
gbazin Exp $
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
*
...
@@ -38,7 +38,8 @@
...
@@ -38,7 +38,8 @@
#include "ffmpeg.h"
#include "ffmpeg.h"
void
ChromaConversion
(
vout_thread_t
*
,
picture_t
*
,
picture_t
*
);
void
E_
(
ffmpeg_InitLibavcodec
)
(
vlc_object_t
*
p_object
);
static
void
ChromaConversion
(
vout_thread_t
*
,
picture_t
*
,
picture_t
*
);
/*****************************************************************************
/*****************************************************************************
* chroma_sys_t: chroma method descriptor
* chroma_sys_t: chroma method descriptor
...
@@ -146,13 +147,16 @@ int E_(OpenChroma)( vlc_object_t *p_this )
...
@@ -146,13 +147,16 @@ int E_(OpenChroma)( vlc_object_t *p_this )
p_vout
->
chroma
.
p_sys
->
i_src_ffmpeg_chroma
=
i_ffmpeg_chroma
[
0
];
p_vout
->
chroma
.
p_sys
->
i_src_ffmpeg_chroma
=
i_ffmpeg_chroma
[
0
];
p_vout
->
chroma
.
p_sys
->
i_dst_ffmpeg_chroma
=
i_ffmpeg_chroma
[
1
];
p_vout
->
chroma
.
p_sys
->
i_dst_ffmpeg_chroma
=
i_ffmpeg_chroma
[
1
];
/* libavcodec needs to be initialized for some chroma conversions */
E_
(
ffmpeg_InitLibavcodec
)(
p_this
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
/*****************************************************************************
/*****************************************************************************
* ChromaConversion: actual chroma conversion function
* ChromaConversion: actual chroma conversion function
*****************************************************************************/
*****************************************************************************/
void
ChromaConversion
(
vout_thread_t
*
p_vout
,
static
void
ChromaConversion
(
vout_thread_t
*
p_vout
,
picture_t
*
p_src
,
picture_t
*
p_dest
)
picture_t
*
p_src
,
picture_t
*
p_dest
)
{
{
AVPicture
src_pic
;
AVPicture
src_pic
;
...
...
modules/codec/ffmpeg/ffmpeg.c
View file @
e14437f3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.5
0 2003/09/20 01:36:57 hartma
n Exp $
* $Id: ffmpeg.c,v 1.5
1 2003/09/26 16:10:24 gbazi
n Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -67,13 +67,14 @@
...
@@ -67,13 +67,14 @@
* Local prototypes
* Local prototypes
*/
*/
int
E_
(
OpenChroma
)
(
vlc_object_t
*
);
int
E_
(
OpenChroma
)
(
vlc_object_t
*
);
void
E_
(
ffmpeg_InitLibavcodec
)
(
vlc_object_t
*
p_object
);
static
int
OpenDecoder
(
vlc_object_t
*
);
static
int
OpenDecoder
(
vlc_object_t
*
);
static
int
RunDecoder
(
decoder_fifo_t
*
);
static
int
RunDecoder
(
decoder_fifo_t
*
);
static
int
InitThread
(
generic_thread_t
*
);
static
int
InitThread
(
generic_thread_t
*
);
static
void
EndThread
(
generic_thread_t
*
);
static
void
EndThread
(
generic_thread_t
*
);
static
int
b_ffmpeginit
=
0
;
static
int
b_ffmpeginit
=
0
;
static
int
ffmpeg_GetFfmpegCodec
(
vlc_fourcc_t
,
int
*
,
int
*
,
char
**
);
static
int
ffmpeg_GetFfmpegCodec
(
vlc_fourcc_t
,
int
*
,
int
*
,
char
**
);
...
@@ -282,28 +283,8 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
...
@@ -282,28 +283,8 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
static
int
InitThread
(
generic_thread_t
*
p_decoder
)
static
int
InitThread
(
generic_thread_t
*
p_decoder
)
{
{
int
i_result
;
int
i_result
;
vlc_value_t
lockval
;
E_
(
ffmpeg_InitLibavcodec
)(
VLC_OBJECT
(
p_decoder
->
p_fifo
));
var_Get
(
p_decoder
->
p_fifo
->
p_libvlc
,
"avcodec"
,
&
lockval
);
vlc_mutex_lock
(
lockval
.
p_address
);
/* *** init ffmpeg library (libavcodec) *** */
if
(
!
b_ffmpeginit
)
{
avcodec_init
();
avcodec_register_all
();
b_ffmpeginit
=
1
;
msg_Dbg
(
p_decoder
->
p_fifo
,
"libavcodec initialized (interface %d )"
,
LIBAVCODEC_BUILD
);
}
else
{
msg_Dbg
(
p_decoder
->
p_fifo
,
"libavcodec already initialized"
);
}
vlc_mutex_unlock
(
lockval
.
p_address
);
/* *** determine codec type *** */
/* *** determine codec type *** */
ffmpeg_GetFfmpegCodec
(
p_decoder
->
p_fifo
->
i_fourcc
,
ffmpeg_GetFfmpegCodec
(
p_decoder
->
p_fifo
->
i_fourcc
,
...
@@ -645,3 +626,28 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
...
@@ -645,3 +626,28 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
return
(
VLC_FALSE
);
return
(
VLC_FALSE
);
}
}
void
E_
(
ffmpeg_InitLibavcodec
)
(
vlc_object_t
*
p_object
)
{
vlc_value_t
lockval
;
var_Get
(
p_object
->
p_libvlc
,
"avcodec"
,
&
lockval
);
vlc_mutex_lock
(
lockval
.
p_address
);
/* *** init ffmpeg library (libavcodec) *** */
if
(
!
b_ffmpeginit
)
{
avcodec_init
();
avcodec_register_all
();
b_ffmpeginit
=
1
;
msg_Dbg
(
p_object
,
"libavcodec initialized (interface %d )"
,
LIBAVCODEC_BUILD
);
}
else
{
msg_Dbg
(
p_object
,
"libavcodec already initialized"
);
}
vlc_mutex_unlock
(
lockval
.
p_address
);
}
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