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

Unified Diff: media/cast/transport/cast_transport_config.h

Issue 288103002: [Cast] EncodedAudioFrame+EncodedVideoFrame+reference_time --> EncodedFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/test/end2end_unittest.cc ('k') | media/cast/transport/cast_transport_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/transport/cast_transport_config.h
diff --git a/media/cast/transport/cast_transport_config.h b/media/cast/transport/cast_transport_config.h
index d7d3196857e8389f08d4b2d738c45ffc800264fd..b25ce4e28513b847c15c634ff7a4b44326a92969 100644
--- a/media/cast/transport/cast_transport_config.h
+++ b/media/cast/transport/cast_transport_config.h
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
+#include "base/stl_util.h"
#include "media/cast/transport/cast_transport_defines.h"
#include "net/base/ip_endpoint.h"
@@ -69,27 +70,68 @@ struct CastTransportVideoConfig {
VideoCodec codec;
};
-struct EncodedVideoFrame {
- EncodedVideoFrame();
- ~EncodedVideoFrame();
+// A combination of metadata and data for one encoded frame. This can contain
+// audio data or video data or other.
+struct EncodedFrame {
+ enum Dependency {
+ // "null" value, used to indicate whether |dependency| has been set.
+ UNKNOWN_DEPENDENCY,
- VideoCodec codec;
- bool key_frame;
+ // Not decodable without the reference frame indicated by
+ // |referenced_frame_id|.
+ DEPENDENT,
+
+ // Independently decodable.
+ INDEPENDENT,
+
+ // Independently decodable, and no future frames will depend on any frames
+ // before this one.
+ KEY,
+
+ DEPENDENCY_LAST = KEY
+ };
+
+ EncodedFrame();
+ ~EncodedFrame();
+
+ // Convenience accessors to data as an array of uint8 elements.
+ const uint8* bytes() const {
+ return reinterpret_cast<uint8*>(string_as_array(
+ const_cast<std::string*>(&data)));
+ }
+ uint8* mutable_bytes() {
+ return reinterpret_cast<uint8*>(string_as_array(&data));
+ }
+
+ // This frame's dependency relationship with respect to other frames.
+ Dependency dependency;
+
+ // The label associated with this frame. Implies an ordering relative to
+ // other frames in the same stream.
uint32 frame_id;
- uint32 last_referenced_frame_id;
- uint32 rtp_timestamp;
- std::string data;
-};
-struct EncodedAudioFrame {
- EncodedAudioFrame();
- ~EncodedAudioFrame();
+ // The label associated with the frame upon which this frame depends. If
+ // this frame does not require any other frame in order to become decodable
+ // (e.g., key frames), |referenced_frame_id| must equal |frame_id|.
+ uint32 referenced_frame_id;
- AudioCodec codec;
- uint32 frame_id; // Needed to release the frame.
+ // The stream timestamp, on the timeline of the signal data. For example, RTP
+ // timestamps for audio are usually defined as the total number of audio
+ // samples encoded in all prior frames. A playback system uses this value to
+ // detect gaps in the stream, and otherwise stretch the signal to match
+ // playout targets.
uint32 rtp_timestamp;
- // Support for max sampling rate of 48KHz, 2 channels, 100 ms duration.
- static const int kMaxNumberOfSamples = 48 * 2 * 100;
+
+ // The common reference clock timestamp for this frame. This value originates
+ // from a sender and is used to provide lip synchronization between streams in
+ // a receiver. Thus, in the sender context, this is set to the time at which
+ // the frame was captured/recorded. In the receiver context, this is set to
+ // the target playout time. Over a sequence of frames, this time value is
+ // expected to drift with respect to the elapsed time implied by the RTP
+ // timestamps; and it may not necessarily increment with precise regularity.
+ base::TimeTicks reference_time;
+
+ // The encoded signal data.
std::string data;
};
« no previous file with comments | « media/cast/test/end2end_unittest.cc ('k') | media/cast/transport/cast_transport_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698