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

Unified Diff: media/cast/cast_sender.h

Issue 906403006: [Cast] Size-Adaptable platform video encoders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed hubbe's comments. Created 5 years, 10 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/cast_config.cc ('k') | media/cast/cast_sender_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/cast_sender.h
diff --git a/media/cast/cast_sender.h b/media/cast/cast_sender.h
index 1ccebd1bb5d8bec1130f3dbf2b788e05300157f5..7c6891312b48132f90627b929d1beb5780ec2dd1 100644
--- a/media/cast/cast_sender.h
+++ b/media/cast/cast_sender.h
@@ -21,6 +21,10 @@
#include "media/cast/cast_environment.h"
#include "media/cast/net/cast_transport_sender.h"
+namespace gfx {
+class Size;
+}
+
namespace media {
class VideoFrame;
@@ -40,14 +44,18 @@ class VideoFrameInput : public base::RefCountedThreadSafe<VideoFrameInput> {
// frames offer performance benefits, such as memory copy elimination. The
// format is guaranteed to be I420 or NV12.
//
- // Not every encoder supports this method. Use |ShouldCreateOptimizedFrame|
- // to determine if you can and should use this method. Calling
- // this method when |ShouldCreateOptimizedFrame| is false will CHECK.
- virtual scoped_refptr<VideoFrame> CreateOptimizedFrame(
- base::TimeDelta timestamp) = 0;
+ // Not every encoder supports this method. Use |CanCreateOptimizedFrames| to
+ // determine if you can and should use this method.
+ //
+ // Even if |CanCreateOptimizedFrames| indicates support, there are transient
+ // conditions during a session where optimized frames cannot be provided. In
+ // this case, the caller must be able to account for a nullptr return value
+ // and instantiate its own media::VideoFrames.
+ virtual scoped_refptr<VideoFrame> MaybeCreateOptimizedFrame(
+ const gfx::Size& frame_size, base::TimeDelta timestamp) = 0;
// Returns true if the encoder supports creating optimized frames.
- virtual bool SupportsCreateOptimizedFrame() const = 0;
+ virtual bool CanCreateOptimizedFrames() const = 0;
protected:
virtual ~VideoFrameInput() {}
« no previous file with comments | « media/cast/cast_config.cc ('k') | media/cast/cast_sender_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698