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

Unified Diff: services/media/framework_mojo/mojo_producer.cc

Issue 2006093004: Motown: Convert MediaSink to expose MediaTimelineControlSite (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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 | « services/media/framework_mojo/mojo_producer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/media/framework_mojo/mojo_producer.cc
diff --git a/services/media/framework_mojo/mojo_producer.cc b/services/media/framework_mojo/mojo_producer.cc
index 7fb0ae333665e3d9d4f3ec6410f795af5825de8f..33df5a8c318181853d7dce38dde9c201c01a2f79 100644
--- a/services/media/framework_mojo/mojo_producer.cc
+++ b/services/media/framework_mojo/mojo_producer.cc
@@ -42,7 +42,6 @@ void MojoProducer::PrimeConnection(const PrimeConnectionCallback& callback) {
DCHECK(demand_callback_);
demand_callback_(demand);
- SetState(MediaState::PAUSED);
if (consumer_.is_bound()) {
consumer_->Prime([this, callback]() { callback.Run(); });
@@ -65,17 +64,6 @@ void MojoProducer::FlushConnection(const FlushConnectionCallback& callback) {
} else {
callback.Run();
}
-
- first_pts_since_flush_ = Packet::kUnknownPts;
- end_of_stream_ = false;
-}
-
-void MojoProducer::SetStatusCallback(const StatusCallback& callback) {
- status_callback_ = callback;
-}
-
-int64_t MojoProducer::GetFirstPtsSinceFlush() {
- return first_pts_since_flush_;
}
PayloadAllocator* MojoProducer::allocator() {
@@ -89,18 +77,10 @@ void MojoProducer::SetDemandCallback(const DemandCallback& demand_callback) {
Demand MojoProducer::SupplyPacket(PacketPtr packet) {
DCHECK(packet);
- if (first_pts_since_flush_ == Packet::kUnknownPts) {
- first_pts_since_flush_ = packet->pts();
- }
-
// If we're not connected, throw the packet away.
if (!consumer_.is_bound()) {
if (packet->end_of_stream()) {
- {
- base::AutoLock lock(lock_);
- end_of_stream_ = true;
- }
- SetState(MediaState::ENDED);
+ base::AutoLock lock(lock_);
kulakowski 2016/05/24 20:27:52 I don't think you need to lock here.
return Demand::kNegative;
}
@@ -112,12 +92,10 @@ Demand MojoProducer::SupplyPacket(PacketPtr packet) {
{
base::AutoLock lock(lock_);
DCHECK(current_pushes_outstanding_ < max_pushes_outstanding_);
- DCHECK(!end_of_stream_) << "packet pushed after end-of-stream";
++current_pushes_outstanding_;
if (packet->end_of_stream()) {
- end_of_stream_ = true;
demand = Demand::kNegative;
max_pushes_outstanding_ = 0;
} else {
@@ -153,7 +131,6 @@ void MojoProducer::Connect(InterfaceHandle<MediaConsumer> consumer,
void MojoProducer::Disconnect() {
DCHECK(demand_callback_);
demand_callback_(Demand::kNegative);
- SetState(MediaState::UNPREPARED);
consumer_.reset();
}
@@ -174,22 +151,9 @@ void MojoProducer::SendPacket(Packet* packet_raw_ptr,
DCHECK(demand_callback_);
demand_callback_(demand);
-
- if (end_of_stream_ && packet->end_of_stream()) {
- SetState(MediaState::ENDED);
- }
});
}
-void MojoProducer::SetState(MediaState state) {
- if (state_ != state) {
- state_ = state;
- if (status_callback_) {
- status_callback_(state_);
- }
- }
-}
-
MediaPacketPtr MojoProducer::CreateMediaPacket(const PacketPtr& packet) {
DCHECK(packet);
« no previous file with comments | « services/media/framework_mojo/mojo_producer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698