Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
756a5141
Commit
756a5141
authored
Feb 19, 2013
by
Yann Diorcet
Browse files
Add swscale compatibility to old version
parent
73a772ac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
0 deletions
+22
-0
src/videofilters/h264dec.c
src/videofilters/h264dec.c
+5
-0
src/videofilters/jpegwriter.c
src/videofilters/jpegwriter.c
+4
-0
src/videofilters/nowebcam.c
src/videofilters/nowebcam.c
+4
-0
src/videofilters/videodec.c
src/videofilters/videodec.c
+5
-0
src/voip/msvideo.c
src/voip/msvideo.c
+4
-0
No files found.
src/videofilters/h264dec.c
View file @
756a5141
...
...
@@ -122,8 +122,13 @@ static mblk_t *get_as_yuvmsg(MSFilter *f, DecData *s, AVFrame *orig){
ctx
->
width
,
ctx
->
height
,
PIX_FMT_YUV420P
,
SWS_FAST_BILINEAR
,
NULL
,
NULL
,
NULL
);
}
#if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)
if
(
sws_scale
(
s
->
sws_ctx
,(
const
uint8_t
*
const
*
)
orig
->
data
,
orig
->
linesize
,
0
,
ctx
->
height
,
s
->
outbuf
.
planes
,
s
->
outbuf
.
strides
)
<
0
){
#else
if
(
sws_scale
(
s
->
sws_ctx
,(
uint8_t
**
)
orig
->
data
,
orig
->
linesize
,
0
,
ctx
->
height
,
s
->
outbuf
.
planes
,
s
->
outbuf
.
strides
)
<
0
){
#endif
ms_error
(
"%s: error in sws_scale()."
,
f
->
desc
->
name
);
}
return
dupmsg
(
s
->
yuv_msg
);
...
...
src/videofilters/jpegwriter.c
View file @
756a5141
...
...
@@ -113,7 +113,11 @@ static void jpg_process(MSFilter *f){
goto
end
;
}
jpegm
=
ms_yuv_buf_alloc
(
&
yuvjpeg
,
avctx
->
width
,
avctx
->
height
);
#if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)
if
(
sws_scale
(
sws_ctx
,(
const
uint8_t
*
const
*
)
yuvbuf
.
planes
,
yuvbuf
.
strides
,
0
,
avctx
->
height
,
yuvjpeg
.
planes
,
yuvjpeg
.
strides
)
<
0
){
#else
if
(
sws_scale
(
sws_ctx
,(
uint8_t
**
)
yuvbuf
.
planes
,
yuvbuf
.
strides
,
0
,
avctx
->
height
,
yuvjpeg
.
planes
,
yuvjpeg
.
strides
)
<
0
){
#endif
ms_error
(
"sws_scale() failed."
);
sws_freeContext
(
sws_ctx
);
cleanup
(
s
,
avctx
);
...
...
src/videofilters/nowebcam.c
View file @
756a5141
...
...
@@ -95,7 +95,11 @@ static mblk_t *jpeg2yuv(uint8_t *jpgbuf, int bufsize, MSVideoSize *reqsize){
return
NULL
;
}
#if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)
if
(
sws_scale
(
sws_ctx
,(
const
uint8_t
*
const
*
)
orig
.
data
,
orig
.
linesize
,
0
,
av_context
.
height
,
dest
.
planes
,
dest
.
strides
)
<
0
){
#else
if
(
sws_scale
(
sws_ctx
,(
uint8_t
**
)
orig
.
data
,
orig
.
linesize
,
0
,
av_context
.
height
,
dest
.
planes
,
dest
.
strides
)
<
0
){
#endif
ms_error
(
"jpeg2yuv: ms_sws_scale() failed."
);
sws_freeContext
(
sws_ctx
);
avcodec_close
(
&
av_context
);
...
...
src/videofilters/videodec.c
View file @
756a5141
...
...
@@ -621,8 +621,13 @@ static mblk_t *get_as_yuvmsg(MSFilter *f, DecState *s, AVFrame *orig){
ms_error
(
"%s: missing rescaling context."
,
f
->
desc
->
name
);
return
NULL
;
}
#if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)
if
(
sws_scale
(
s
->
sws_ctx
,(
const
uint8_t
*
const
*
)
orig
->
data
,
orig
->
linesize
,
0
,
ctx
->
height
,
s
->
outbuf
.
planes
,
s
->
outbuf
.
strides
)
<
0
){
#else
if
(
sws_scale
(
s
->
sws_ctx
,(
uint8_t
**
)
orig
->
data
,
orig
->
linesize
,
0
,
ctx
->
height
,
s
->
outbuf
.
planes
,
s
->
outbuf
.
strides
)
<
0
){
#endif
ms_error
(
"%s: error in ms_sws_scale()."
,
f
->
desc
->
name
);
}
return
dupmsg
(
s
->
yuv_msg
);
...
...
src/voip/msvideo.c
View file @
756a5141
...
...
@@ -427,7 +427,11 @@ static MSScalerContext *ff_create_swscale_context(int src_w, int src_h, MSPixFmt
static
int
ff_sws_scale
(
MSScalerContext
*
ctx
,
uint8_t
*
src
[],
int
src_strides
[],
uint8_t
*
dst
[],
int
dst_strides
[]){
MSFFScalerContext
*
fctx
=
(
MSFFScalerContext
*
)
ctx
;
#if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)
int
err
=
sws_scale
(
fctx
->
ctx
,(
const
uint8_t
*
const
*
)
src
,
src_strides
,
0
,
fctx
->
src_h
,
dst
,
dst_strides
);
#else
int
err
=
sws_scale
(
fctx
->
ctx
,(
uint8_t
**
)
src
,
src_strides
,
0
,
fctx
->
src_h
,
dst
,
dst_strides
);
#endif
if
(
err
<
0
)
return
-
1
;
return
0
;
}
...
...
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