Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(948)

Unified Diff: media/cast/sender/vp8_encoder.h

Issue 892383002: RELAND: [Cast] Software encoder support for varying video frame sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for 'access to uninitialized memory' error. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/sender/video_sender.cc ('k') | media/cast/sender/vp8_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/vp8_encoder.h
diff --git a/media/cast/sender/vp8_encoder.h b/media/cast/sender/vp8_encoder.h
index 387dbf27a4b92652f8d05a03ee042a83b7196544..2de51d4663cab8b34aa47a331a6c82302d51fd62 100644
--- a/media/cast/sender/vp8_encoder.h
+++ b/media/cast/sender/vp8_encoder.h
@@ -11,6 +11,7 @@
#include "media/cast/cast_config.h"
#include "media/cast/sender/software_video_encoder.h"
#include "third_party/libvpx/source/libvpx/vpx/vpx_encoder.h"
+#include "ui/gfx/geometry/size.h"
namespace media {
class VideoFrame;
@@ -56,11 +57,17 @@ class Vp8Encoder : public SoftwareVideoEncoder {
};
bool is_initialized() const {
- // Initialize() sets the timebase denominator value to non-zero if the
- // encoder is successfully initialized, and it is zero otherwise.
+ // ConfigureForNewFrameSize() sets the timebase denominator value to
+ // non-zero if the encoder is successfully initialized, and it is zero
+ // otherwise.
return config_.g_timebase.den != 0;
}
+ // If the |encoder_| is live, attempt reconfiguration to allow it to encode
+ // frames at a new |frame_size|. Otherwise, tear it down and re-create a new
+ // |encoder_| instance.
+ void ConfigureForNewFrameSize(const gfx::Size& frame_size);
+
// Calculate which next Vp8 buffers to update with the next frame.
Vp8Buffers GetNextBufferToUpdate();
@@ -80,12 +87,13 @@ class Vp8Encoder : public SoftwareVideoEncoder {
vpx_codec_enc_cfg_t config_;
vpx_codec_ctx_t encoder_;
- // Wrapper for access to YUV data planes in a media::VideoFrame.
- vpx_image_t* raw_image_;
-
// Set to true to request the next frame emitted by Vp8Encoder be a key frame.
bool key_frame_requested_;
+ // Saves the current bitrate setting, for when the |encoder_| is reconfigured
+ // for different frame sizes.
+ int bitrate_kbit_;
+
// The |VideoFrame::timestamp()| of the last encoded frame. This is used to
// predict the duration of the next frame.
base::TimeDelta last_frame_timestamp_;
« no previous file with comments | « media/cast/sender/video_sender.cc ('k') | media/cast/sender/vp8_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698