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

Unified Diff: media/cast/cast_receiver.h

Issue 308043006: [Cast] Clean-up: Merge RtpReceiver+AudioReceiver+VideoReceiver-->FrameReceiver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed hclam's comments. Created 6 years, 7 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.gyp ('k') | media/cast/cast_receiver_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/cast_receiver.h
diff --git a/media/cast/cast_receiver.h b/media/cast/cast_receiver.h
index 2d83dd263fd28200268f3eb6f37198a64a31c8f6..a9d3edeb78ecc25f2a9bd15aa793cb11d0ed34dd 100644
--- a/media/cast/cast_receiver.h
+++ b/media/cast/cast_receiver.h
@@ -45,27 +45,8 @@ typedef base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame,
// dropped (i.e., frame_id should be incrementing by one each time). Note: A
// NULL pointer can be returned on error.
typedef base::Callback<void(scoped_ptr<transport::EncodedFrame>)>
- FrameEncodedCallback;
+ ReceiveEncodedFrameCallback;
-// This Class is thread safe.
-class FrameReceiver : public base::RefCountedThreadSafe<FrameReceiver> {
- public:
- virtual void GetRawAudioFrame(const AudioFrameDecodedCallback& callback) = 0;
-
- virtual void GetCodedAudioFrame(const FrameEncodedCallback& callback) = 0;
-
- virtual void GetRawVideoFrame(const VideoFrameDecodedCallback& callback) = 0;
-
- virtual void GetEncodedVideoFrame(const FrameEncodedCallback& callback) = 0;
-
- protected:
- virtual ~FrameReceiver() {}
-
- private:
- friend class base::RefCountedThreadSafe<FrameReceiver>;
-};
-
-// This Class is thread safe.
class CastReceiver {
public:
static scoped_ptr<CastReceiver> Create(
@@ -75,13 +56,28 @@ class CastReceiver {
transport::PacketSender* const packet_sender);
// All received RTP and RTCP packets for the call should be sent to this
- // PacketReceiver. Can be called from any function.
+ // PacketReceiver. Can be called from any thread.
// TODO(hubbe): Replace with:
// virtual void ReceivePacket(scoped_ptr<Packet> packet) = 0;
virtual transport::PacketReceiverCallback packet_receiver() = 0;
- // Polling interface to get audio and video frames from the CastReceiver.
- virtual scoped_refptr<FrameReceiver> frame_receiver() = 0;
+ // Polling interface to get audio and video frames from the CastReceiver. The
+ // the RequestDecodedXXXXXFrame() methods utilize internal software-based
+ // decoding, while the RequestEncodedXXXXXFrame() methods provides
+ // still-encoded frames for use with external/hardware decoders.
+ //
+ // In all cases, the given |callback| is guaranteed to be run at some point in
+ // the future, except for those requests still enqueued at destruction time.
+ //
+ // These methods should all be called on the CastEnvironment's MAIN thread.
+ virtual void RequestDecodedAudioFrame(
+ const AudioFrameDecodedCallback& callback) = 0;
+ virtual void RequestEncodedAudioFrame(
+ const ReceiveEncodedFrameCallback& callback) = 0;
+ virtual void RequestDecodedVideoFrame(
+ const VideoFrameDecodedCallback& callback) = 0;
+ virtual void RequestEncodedVideoFrame(
+ const ReceiveEncodedFrameCallback& callback) = 0;
virtual ~CastReceiver() {}
};
« no previous file with comments | « media/cast/cast.gyp ('k') | media/cast/cast_receiver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698