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

Unified Diff: chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc

Issue 1149263002: Chromecast: Add stream id interface in DecoderBufferBase class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment message Created 5 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 | « chromecast/media/cma/base/decoder_buffer_base.h ('k') | chromecast/media/cma/pipeline/decrypt_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc
diff --git a/chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc b/chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc
index a377ae66337e5ab9014c7675f3a6e6e6c35d825e..93421a5139c3184e7428bd57b0c5e116f739a8ca 100644
--- a/chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc
+++ b/chromecast/media/cma/ipc_streamer/decoder_buffer_base_marshaller.cc
@@ -24,6 +24,7 @@ class DecoderBufferFromMsg : public DecoderBufferBase {
void Initialize();
// DecoderBufferBase implementation.
+ StreamId stream_id() const override;
base::TimeDelta timestamp() const override;
const uint8* data() const override;
uint8* writable_data() const override;
@@ -37,6 +38,9 @@ class DecoderBufferFromMsg : public DecoderBufferBase {
// Indicates whether this is an end of stream frame.
bool is_eos_;
+ // Stream Id this decoder buffer belongs to.
+ StreamId stream_id_;
+
// Frame timestamp.
base::TimeDelta pts_;
@@ -56,6 +60,7 @@ class DecoderBufferFromMsg : public DecoderBufferBase {
DecoderBufferFromMsg::DecoderBufferFromMsg(
scoped_ptr<MediaMessage> msg)
: is_eos_(true),
+ stream_id_(kPrimary),
msg_(msg.Pass()),
data_(NULL) {
CHECK(msg_);
@@ -71,6 +76,8 @@ void DecoderBufferFromMsg::Initialize() {
if (is_eos_)
return;
+ CHECK(msg_->ReadPod(&stream_id_));
+
int64 pts_internal = 0;
CHECK(msg_->ReadPod(&pts_internal));
pts_ = base::TimeDelta::FromInternalValue(pts_internal);
@@ -99,6 +106,10 @@ void DecoderBufferFromMsg::Initialize() {
}
}
+StreamId DecoderBufferFromMsg::stream_id() const {
+ return stream_id_;
+}
+
base::TimeDelta DecoderBufferFromMsg::timestamp() const {
return pts_;
}
@@ -135,6 +146,7 @@ void DecoderBufferBaseMarshaller::Write(
if (buffer->end_of_stream())
return;
+ CHECK(msg->WritePod(buffer->stream_id()));
CHECK(msg->WritePod(buffer->timestamp().ToInternalValue()));
bool has_decrypt_config =
« no previous file with comments | « chromecast/media/cma/base/decoder_buffer_base.h ('k') | chromecast/media/cma/pipeline/decrypt_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698