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

Side by Side Diff: services/media/framework_ffmpeg/ffmpeg_demux.cc

Issue 2077413003: Motown: Various fixes related to video playback support (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Comments and name changes for clarity. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <condition_variable> 5 #include <condition_variable>
6 #include <map> 6 #include <map>
7 #include <mutex> 7 #include <mutex>
8 #include <thread> 8 #include <thread>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 if (av_read_frame(format_context_.get(), av_packet.get()) < 0) { 289 if (av_read_frame(format_context_.get(), av_packet.get()) < 0) {
290 // End of stream. Start producing end-of-stream packets for all the streams. 290 // End of stream. Start producing end-of-stream packets for all the streams.
291 next_stream_to_end_ = 0; 291 next_stream_to_end_ = 0;
292 return PullEndOfStreamPacket(stream_index_out); 292 return PullEndOfStreamPacket(stream_index_out);
293 } 293 }
294 294
295 *stream_index_out = static_cast<size_t>(av_packet->stream_index); 295 *stream_index_out = static_cast<size_t>(av_packet->stream_index);
296 // TODO(dalesat): What if the packet has no PTS or duration? 296 // TODO(dalesat): What if the packet has no PTS or duration?
297 next_pts_ = av_packet->pts + av_packet->duration; 297 next_pts_ = av_packet->pts + av_packet->duration;
298 // TODO(dalesat): Implement packet side data.
299 DCHECK(av_packet->side_data == nullptr) << "side data not implemented";
300 DCHECK(av_packet->side_data_elems == 0);
298 301
299 return DemuxPacket::Create(std::move(av_packet)); 302 return DemuxPacket::Create(std::move(av_packet));
300 } 303 }
301 304
302 PacketPtr FfmpegDemuxImpl::PullEndOfStreamPacket(size_t* stream_index_out) { 305 PacketPtr FfmpegDemuxImpl::PullEndOfStreamPacket(size_t* stream_index_out) {
303 DCHECK(next_stream_to_end_ >= 0); 306 DCHECK(next_stream_to_end_ >= 0);
304 307
305 if (static_cast<std::size_t>(next_stream_to_end_) >= streams_.size()) { 308 if (static_cast<std::size_t>(next_stream_to_end_) >= streams_.size()) {
306 NOTREACHED() << "PullPacket called after all streams have ended"; 309 NOTREACHED() << "PullPacket called after all streams have ended";
307 return nullptr; 310 return nullptr;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 return index_; 343 return index_;
341 } 344 }
342 345
343 std::unique_ptr<StreamType> FfmpegDemuxImpl::FfmpegDemuxStream::stream_type() 346 std::unique_ptr<StreamType> FfmpegDemuxImpl::FfmpegDemuxStream::stream_type()
344 const { 347 const {
345 return SafeClone(stream_type_); 348 return SafeClone(stream_type_);
346 } 349 }
347 350
348 } // namespace media 351 } // namespace media
349 } // namespace mojo 352 } // namespace mojo
OLDNEW
« no previous file with comments | « services/media/framework_ffmpeg/ffmpeg_decoder_base.cc ('k') | services/media/framework_ffmpeg/ffmpeg_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698