Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gst-libav
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
60
Issues
60
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GStreamer
gst-libav
Commits
25003e43
Commit
25003e43
authored
Oct 01, 2009
by
Sebastian Dröge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "ffenc: Make sure to always provide large enough buffers"
This reverts commit
d9f6febe
.
parent
799b19c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
ext/ffmpeg/gstffmpegenc.c
ext/ffmpeg/gstffmpegenc.c
+5
-16
No files found.
ext/ffmpeg/gstffmpegenc.c
View file @
25003e43
...
...
@@ -642,19 +642,13 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
static
void
ffmpegenc_setup_working_buf
(
GstFFMpegEnc
*
ffmpegenc
)
{
guint
wanted_size
=
ffmpegenc
->
context
->
width
*
ffmpegenc
->
context
->
height
*
6
+
200
;
/* Above is the buffer size used by ffmpeg/ffmpeg.c */
if
(
ffmpegenc
->
working_buf
==
NULL
||
ffmpegenc
->
working_buf_size
!=
wanted
_size
)
{
ffmpegenc
->
working_buf_size
!=
ffmpegenc
->
buffer
_size
)
{
if
(
ffmpegenc
->
working_buf
)
g_free
(
ffmpegenc
->
working_buf
);
ffmpegenc
->
working_buf_size
=
wanted
_size
;
ffmpegenc
->
working_buf_size
=
ffmpegenc
->
buffer
_size
;
ffmpegenc
->
working_buf
=
g_malloc
(
ffmpegenc
->
working_buf_size
);
}
ffmpegenc
->
buffer_size
=
wanted_size
;
}
static
GstFlowReturn
...
...
@@ -748,8 +742,6 @@ gst_ffmpegenc_encode_audio (GstFFMpegEnc * ffmpegenc, guint8 * audio_in,
audio_out
=
GST_BUFFER_DATA
(
outbuf
);
GST_LOG_OBJECT
(
ffmpegenc
,
"encoding buffer of max size %d"
,
max_size
);
if
(
ffmpegenc
->
buffer_size
!=
max_size
)
ffmpegenc
->
buffer_size
=
max_size
;
res
=
avcodec_encode_audio
(
ctx
,
audio_out
,
max_size
,
(
short
*
)
audio_in
);
...
...
@@ -857,9 +849,8 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
ctx
->
sample_rate
);
duration
-=
(
timestamp
-
ffmpegenc
->
adapter_ts
);
/* 4 times the input size plus the minimal buffer size
* should be big enough... */
out_size
=
frame_bytes
*
4
+
FF_MIN_BUFFER_SIZE
;
/* 4 times the input size should be big enough... */
out_size
=
MAX
(
frame_bytes
*
4
,
FF_MIN_BUFFER_SIZE
);
ret
=
gst_ffmpegenc_encode_audio
(
ffmpegenc
,
in_data
,
out_size
,
timestamp
,
duration
,
ffmpegenc
->
discont
);
...
...
@@ -887,9 +878,6 @@ gst_ffmpegenc_chain_audio (GstPad * pad, GstBuffer * inbuf)
if
(
coded_bps
)
out_size
*=
coded_bps
;
/* We need to provide at least ffmpegs minimal buffer size */
out_size
+=
FF_MIN_BUFFER_SIZE
;
in_data
=
(
guint8
*
)
GST_BUFFER_DATA
(
inbuf
);
ret
=
gst_ffmpegenc_encode_audio
(
ffmpegenc
,
in_data
,
out_size
,
timestamp
,
duration
,
discont
);
...
...
@@ -1050,6 +1038,7 @@ gst_ffmpegenc_set_property (GObject * object,
ffmpegenc
->
me_method
=
g_value_get_enum
(
value
);
break
;
case
ARG_BUFSIZE
:
ffmpegenc
->
buffer_size
=
g_value_get_ulong
(
value
);
break
;
case
ARG_RTP_PAYLOAD_SIZE
:
ffmpegenc
->
rtp_payload_size
=
g_value_get_ulong
(
value
);
...
...
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