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

Unified Diff: media/mojo/interfaces/video_frame_struct_traits.cc

Issue 2933573003: media: Followup changes to VideoFrame StructTraits. (Closed)
Patch Set: const& Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/interfaces/video_frame_struct_traits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/interfaces/video_frame_struct_traits.cc
diff --git a/media/mojo/interfaces/video_frame_struct_traits.cc b/media/mojo/interfaces/video_frame_struct_traits.cc
index 4d6aebf49d67f4a3a451e5f71ced6dbeb552ed73..c68fed42ced567b19afa6ad3b4a084d7cb92a2b3 100644
--- a/media/mojo/interfaces/video_frame_struct_traits.cc
+++ b/media/mojo/interfaces/video_frame_struct_traits.cc
@@ -16,9 +16,10 @@ namespace {
media::mojom::VideoFrameDataPtr MakeVideoFrameData(
const scoped_refptr<media::VideoFrame>& input) {
- // EOS frames contain no data.
- if (input->metadata()->IsTrue(media::VideoFrameMetadata::END_OF_STREAM))
- return nullptr;
+ if (input->metadata()->IsTrue(media::VideoFrameMetadata::END_OF_STREAM)) {
+ return media::mojom::VideoFrameData::NewEosData(
+ media::mojom::EosVideoFrameData::New());
+ }
if (input->storage_type() == media::VideoFrame::STORAGE_MOJO_SHARED_BUFFER) {
media::MojoSharedBufferVideoFrame* mojo_frame =
@@ -86,8 +87,7 @@ bool StructTraits<media::mojom::VideoFrameDataView,
media::mojom::VideoFrameDataDataView data;
input.GetDataDataView(&data);
- DCHECK_EQ(input.end_of_stream(), data.is_null());
- if (input.end_of_stream()) {
+ if (data.is_eos_data()) {
*output = media::VideoFrame::CreateEOSFrame();
return !!*output;
}
@@ -104,11 +104,8 @@ bool StructTraits<media::mojom::VideoFrameDataView,
if (!input.ReadVisibleRect(&visible_rect))
return false;
- // Coded size must contain the visible rect.
- if (visible_rect.right() > coded_size.width() ||
- visible_rect.bottom() > coded_size.height()) {
+ if (!gfx::Rect(coded_size).Contains(visible_rect))
return false;
- }
gfx::Size natural_size;
if (!input.ReadNaturalSize(&natural_size))
« no previous file with comments | « media/mojo/interfaces/video_frame_struct_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698