Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
6bdd2e46
Commit
6bdd2e46
authored
Sep 27, 2005
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support new ffmpeg version
parent
da7b3e71
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
Makefile.am
client_examples/Makefile.am
+1
-1
vnc2mpg.c
client_examples/vnc2mpg.c
+16
-4
No files found.
client_examples/Makefile.am
View file @
6bdd2e46
...
@@ -8,7 +8,7 @@ if HAVE_MP3LAME
...
@@ -8,7 +8,7 @@ if HAVE_MP3LAME
MP3LAME_LIB
=
-lmp3lame
MP3LAME_LIB
=
-lmp3lame
endif
endif
vnc2mpg_CFLAGS
=
-I
$(FFMPEG_HOME)
/libavformat
-I
$(FFMPEG_HOME)
/libavcodec
vnc2mpg_CFLAGS
=
-I
$(FFMPEG_HOME)
/libavformat
-I
$(FFMPEG_HOME)
/libavcodec
-I
$(FFMPEG_HOME)
/libavutil
vnc2mpg_LDADD
=
$(LDADD)
$(FFMPEG_HOME)
/libavformat/libavformat.a
$(FFMPEG_HOME)
/libavcodec/libavcodec.a
$(MP3LAME_LIB)
-lm
vnc2mpg_LDADD
=
$(LDADD)
$(FFMPEG_HOME)
/libavformat/libavformat.a
$(FFMPEG_HOME)
/libavcodec/libavcodec.a
$(MP3LAME_LIB)
-lm
FFMPEG_CLIENT
=
vnc2mpg
FFMPEG_CLIENT
=
vnc2mpg
...
...
client_examples/vnc2mpg.c
View file @
6bdd2e46
...
@@ -55,12 +55,16 @@ AVStream *add_video_stream(AVFormatContext *oc, int codec_id, int w, int h)
...
@@ -55,12 +55,16 @@ AVStream *add_video_stream(AVFormatContext *oc, int codec_id, int w, int h)
exit
(
1
);
exit
(
1
);
}
}
#if LIBAVFORMAT_BUILD<4629
c
=
&
st
->
codec
;
c
=
&
st
->
codec
;
#else
c
=
st
->
codec
;
#endif
c
->
codec_id
=
codec_id
;
c
->
codec_id
=
codec_id
;
c
->
codec_type
=
CODEC_TYPE_VIDEO
;
c
->
codec_type
=
CODEC_TYPE_VIDEO
;
/* put sample parameters */
/* put sample parameters */
c
->
bit_rate
=
4
00000
;
c
->
bit_rate
=
8
00000
;
/* resolution must be a multiple of two */
/* resolution must be a multiple of two */
c
->
width
=
w
;
c
->
width
=
w
;
c
->
height
=
h
;
c
->
height
=
h
;
...
@@ -116,7 +120,11 @@ void open_video(AVFormatContext *oc, AVStream *st)
...
@@ -116,7 +120,11 @@ void open_video(AVFormatContext *oc, AVStream *st)
AVCodec
*
codec
;
AVCodec
*
codec
;
AVCodecContext
*
c
;
AVCodecContext
*
c
;
#if LIBAVFORMAT_BUILD<4629
c
=
&
st
->
codec
;
c
=
&
st
->
codec
;
#else
c
=
st
->
codec
;
#endif
/* find the video encoder */
/* find the video encoder */
codec
=
avcodec_find_encoder
(
c
->
codec_id
);
codec
=
avcodec_find_encoder
(
c
->
codec_id
);
...
@@ -165,7 +173,11 @@ void write_video_frame(AVFormatContext *oc, AVStream *st)
...
@@ -165,7 +173,11 @@ void write_video_frame(AVFormatContext *oc, AVStream *st)
AVCodecContext
*
c
;
AVCodecContext
*
c
;
AVFrame
*
picture_ptr
;
AVFrame
*
picture_ptr
;
#if LIBAVFORMAT_BUILD<4629
c
=
&
st
->
codec
;
c
=
&
st
->
codec
;
#else
c
=
st
->
codec
;
#endif
if
(
c
->
pix_fmt
!=
PIX_FMT_RGB565
)
{
if
(
c
->
pix_fmt
!=
PIX_FMT_RGB565
)
{
/* as we only generate a RGB565 picture, we must convert it
/* as we only generate a RGB565 picture, we must convert it
...
@@ -219,7 +231,7 @@ void write_video_frame(AVFormatContext *oc, AVStream *st)
...
@@ -219,7 +231,7 @@ void write_video_frame(AVFormatContext *oc, AVStream *st)
void
close_video
(
AVFormatContext
*
oc
,
AVStream
*
st
)
void
close_video
(
AVFormatContext
*
oc
,
AVStream
*
st
)
{
{
avcodec_close
(
&
st
->
codec
);
avcodec_close
(
st
->
codec
);
av_free
(
picture
->
data
[
0
]);
av_free
(
picture
->
data
[
0
]);
av_free
(
picture
);
av_free
(
picture
);
if
(
tmp_picture
)
{
if
(
tmp_picture
)
{
...
...
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