Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mediastreamer2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
mediastreamer2
Commits
46b7347d
Commit
46b7347d
authored
Nov 22, 2013
by
jehan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Drop some very old ffmpeg API."
This reverts commit
5c33fb5f
.
parent
5c33fb5f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
20 deletions
+40
-20
.gitignore
.gitignore
+1
-5
ffmpeg-priv.c
src/utils/ffmpeg-priv.c
+17
-0
ffmpeg-priv.h
src/utils/ffmpeg-priv.h
+11
-4
h264dec.c
src/videofilters/h264dec.c
+2
-2
jpegwriter.c
src/videofilters/jpegwriter.c
+2
-2
nowebcam.c
src/videofilters/nowebcam.c
+2
-2
videodec.c
src/videofilters/videodec.c
+3
-3
videoenc.c
src/videofilters/videoenc.c
+2
-2
No files found.
.gitignore
View file @
46b7347d
...
...
@@ -27,12 +27,8 @@ mediastreamer2.spec
missing
stamp-h1
*.gmo
java/bin/
java/libs/
java/gen/
libs
*.dirstamp
*.kdev4
tools/test_x11window
tools/tones
src/utils/ffmpeg-priv.c
View file @
46b7347d
...
...
@@ -20,3 +20,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ffmpeg-priv.h"
#ifdef FF_API_ALLOC_CONTEXT
#if !FF_API_ALLOC_CONTEXT
AVCodecContext
*
avcodec_alloc_context
(
void
)
{
return
avcodec_alloc_context3
(
NULL
);
}
void
avcodec_get_context_defaults
(
AVCodecContext
*
s
)
{
avcodec_get_context_defaults3
(
s
,
NULL
);
}
#endif
#endif
#ifdef FF_API_AVCODEC_OPEN
#if !FF_API_AVCODEC_OPEN
int
avcodec_open
(
AVCodecContext
*
avctx
,
AVCodec
*
codec
)
{
return
avcodec_open2
(
avctx
,
codec
,
NULL
);
}
#endif
#endif
src/utils/ffmpeg-priv.h
View file @
46b7347d
...
...
@@ -35,7 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* new layout */
# include <libavcodec/avcodec.h>
# include <libavutil/avutil.h>
# include <libavutil/mem.h>
#endif
#if defined(HAVE_LIBSWSCALE_SWSCALE_H)
...
...
@@ -60,14 +59,22 @@ static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
return
avcodec_decode_video
(
avctx
,
picture
,
got_picture_ptr
,
avpkt
->
data
,
avpkt
->
size
);
}
#endif
#if (LIBAVCODEC_VERSION_MAJOR >= 56)
#include <libavcodec/old_codec_ids.h>
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,25,0)
#define CodecID AVCodecID
#endif
#ifdef FF_API_ALLOC_CONTEXT
#if !FF_API_ALLOC_CONTEXT
AVCodecContext
*
avcodec_alloc_context
(
void
);
void
avcodec_get_context_defaults
(
AVCodecContext
*
s
);
#endif
#endif
#ifdef FF_API_AVCODEC_OPEN
#if !FF_API_AVCODEC_OPEN
int
avcodec_open
(
AVCodecContext
*
avctx
,
AVCodec
*
codec
);
#endif
#endif
#endif
/*iHAVE_LIBAVCODEC_AVCODEC_H*/
#endif
/* FFMPEG_PRIV_H */
src/videofilters/h264dec.c
View file @
46b7347d
...
...
@@ -58,8 +58,8 @@ static void dec_open(DecData *d){
int
error
;
codec
=
avcodec_find_decoder
(
CODEC_ID_H264
);
if
(
codec
==
NULL
)
ms_fatal
(
"Could not find H264 decoder in ffmpeg."
);
avcodec_get_context_defaults
3
(
&
d
->
av_context
,
NULL
);
error
=
avcodec_open
2
(
&
d
->
av_context
,
codec
,
NULL
);
avcodec_get_context_defaults
(
&
d
->
av_context
);
error
=
avcodec_open
(
&
d
->
av_context
,
codec
);
if
(
error
!=
0
){
ms_fatal
(
"avcodec_open() failed."
);
}
...
...
src/videofilters/jpegwriter.c
View file @
46b7347d
...
...
@@ -90,7 +90,7 @@ static void jpg_process(MSFilter *f){
mblk_t
*
jpegm
;
struct
SwsContext
*
sws_ctx
;
AVCodecContext
*
avctx
=
avcodec_alloc_context
3
(
NULL
);
AVCodecContext
*
avctx
=
avcodec_alloc_context
(
);
avctx
->
width
=
yuvbuf
.
w
;
avctx
->
height
=
yuvbuf
.
h
;
...
...
@@ -98,7 +98,7 @@ static void jpg_process(MSFilter *f){
avctx
->
time_base
.
den
=
1
;
avctx
->
pix_fmt
=
PIX_FMT_YUVJ420P
;
error
=
avcodec_open
2
(
avctx
,
s
->
codec
,
NULL
);
error
=
avcodec_open
(
avctx
,
s
->
codec
);
if
(
error
!=
0
)
{
ms_error
(
"avcodec_open() failed: %i"
,
error
);
cleanup
(
s
,
NULL
);
...
...
src/videofilters/nowebcam.c
View file @
46b7347d
...
...
@@ -68,8 +68,8 @@ static mblk_t *jpeg2yuv(uint8_t *jpgbuf, int bufsize, MSVideoSize *reqsize){
return
NULL
;
}
avcodec_get_context_defaults
3
(
&
av_context
,
NULL
);
if
(
avcodec_open
2
(
&
av_context
,
codec
,
NULL
)
<
0
){
avcodec_get_context_defaults
(
&
av_context
);
if
(
avcodec_open
(
&
av_context
,
codec
)
<
0
){
ms_error
(
"jpeg2yuv: avcodec_open failed"
);
return
NULL
;
}
...
...
src/videofilters/videodec.c
View file @
46b7347d
...
...
@@ -53,7 +53,7 @@ static void dec_init(MSFilter *f, enum CodecID cid){
DecState
*
s
=
(
DecState
*
)
ms_new0
(
DecState
,
1
);
ms_ffmpeg_check_init
();
avcodec_get_context_defaults
3
(
&
s
->
av_context
,
NULL
);
avcodec_get_context_defaults
(
&
s
->
av_context
);
s
->
av_codec
=
NULL
;
s
->
codec
=
cid
;
s
->
input
=
NULL
;
...
...
@@ -135,7 +135,7 @@ static void dec_preprocess(MSFilter *f){
if
(
s
->
av_context
.
codec
==
NULL
){
/* we must know picture size before initializing snow decoder*/
if
(
s
->
codec
!=
CODEC_ID_SNOW
){
error
=
avcodec_open
2
(
&
s
->
av_context
,
s
->
av_codec
,
NULL
);
error
=
avcodec_open
(
&
s
->
av_context
,
s
->
av_codec
);
if
(
error
!=
0
)
ms_error
(
"avcodec_open() failed: %i"
,
error
);
if
(
s
->
codec
==
CODEC_ID_MPEG4
&&
s
->
dci_size
>
0
){
s
->
av_context
.
extradata
=
s
->
dci
;
...
...
@@ -225,7 +225,7 @@ static mblk_t * parse_snow_header(DecState *s,mblk_t *inm){
int
error
;
s
->
av_context
.
width
=
h
>>
16
;
s
->
av_context
.
height
=
h
&
0xffff
;
error
=
avcodec_open
2
(
&
s
->
av_context
,
s
->
av_codec
,
NULL
);
error
=
avcodec_open
(
&
s
->
av_context
,
s
->
av_codec
);
if
(
error
!=
0
)
ms_error
(
"avcodec_open() failed for snow: %i"
,
error
);
else
{
s
->
snow_initialized
=
TRUE
;
...
...
src/videofilters/videoenc.c
View file @
46b7347d
...
...
@@ -281,7 +281,7 @@ static void prepare(EncState *s){
AVCodecContext
*
c
=&
s
->
av_context
;
const
int
max_br_vbv
=
128000
;
avcodec_get_context_defaults
3
(
c
,
NULL
);
avcodec_get_context_defaults
(
c
);
if
(
s
->
codec
==
CODEC_ID_MJPEG
)
{
ms_message
(
"Codec bitrate set to %i"
,
c
->
bit_rate
);
...
...
@@ -387,7 +387,7 @@ static void enc_preprocess(MSFilter *f){
ms_error
(
"could not find encoder for codec id %i"
,
s
->
codec
);
return
;
}
error
=
avcodec_open
2
(
&
s
->
av_context
,
s
->
av_codec
,
NULL
);
error
=
avcodec_open
(
&
s
->
av_context
,
s
->
av_codec
);
if
(
error
!=
0
)
{
ms_error
(
"avcodec_open() failed: %i"
,
error
);
return
;
...
...
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