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 283b5341935cdc82314aba4accb339120fc75807..1e8b68b06c2b6cc14cbc645bfeb4d1d4e7794a73 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,65 @@ struct CastTransportVideoConfig { |
VideoCodec codec; |
}; |
-struct EncodedVideoFrame { |
- EncodedVideoFrame(); |
- ~EncodedVideoFrame(); |
- |
- VideoCodec codec; |
- bool key_frame; |
+// A combination of metadata and data for one encoded frame. This can contain |
+// audio data or video data or other. |
+struct EncodedFrame { |
+ 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 relationship with respect to other frames. |
+ enum Relationship { |
Alpha Left Google
2014/05/16 18:35:22
It seems to me this enum should be called "Depende
miu
2014/05/16 21:28:46
Done.
|
+ // "null" value, used to indicate this field has not been set. |
+ UNKNOWN_RELATIONSHIP, |
Alpha Left Google
2014/05/16 18:35:22
This is not used and will not be used. Please remo
miu
2014/05/16 21:28:46
Done. It was being used to check that the field w
hubbe
2014/05/19 17:54:43
I kind of liked UNKNOWN_RELATIONSHIP.
|
+ |
+ // Not decodable without the reference frame. |
Alpha Left Google
2014/05/16 18:35:22
This comment needs to be clarified: without the re
miu
2014/05/16 21:28:46
Done.
|
+ DEPENDENT, |
+ |
+ // Independently decodable. |
+ INDEPENDENT, |
+ |
+ // Independently decodable, and no future frames will depend on any frames |
+ // before this one. |
+ KEY, |
+ |
+ RELATIONSHIP_LAST = KEY |
+ } relationship; |
hubbe
2014/05/16 17:13:20
I think it's more clear to separate the enum decla
hubbe
2014/05/16 17:13:20
I'm not sure I think "relationship" describes this
miu
2014/05/16 21:28:46
Done.
miu
2014/05/16 21:28:46
Done. Changed it to "dependency," per team discus
|
+ |
+ // 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; |
}; |