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

Unified Diff: content/renderer/media/video_track_adapter.h

Issue 2897993002: Detect frames from rotated devices in VideoTrackAdapter on Android. (Closed)
Patch Set: Created 3 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
Index: content/renderer/media/video_track_adapter.h
diff --git a/content/renderer/media/video_track_adapter.h b/content/renderer/media/video_track_adapter.h
index 97e4994191d73dc8c768e2cd5ef823b715f59f29..ae354adbf24b73e10d0ddc7410c3a2debeaa6ce2 100644
--- a/content/renderer/media/video_track_adapter.h
+++ b/content/renderer/media/video_track_adapter.h
@@ -14,21 +14,28 @@
#include "base/time/time.h"
#include "content/renderer/media/media_stream_video_track.h"
#include "media/base/video_frame.h"
+#include "ui/gfx/geometry/size.h"
namespace content {
struct CONTENT_EXPORT VideoTrackAdapterSettings {
VideoTrackAdapterSettings();
- VideoTrackAdapterSettings(int max_width,
- int max_height,
- double min_aspect_ratio,
- double max_aspect_ratio,
- double max_frame_rate);
+ VideoTrackAdapterSettings(
+ int max_width,
+ int max_height,
+ double min_aspect_ratio,
+ double max_aspect_ratio,
+ double max_frame_rate,
+ const base::Optional<gfx::Size>& expected_native_resolution);
+ VideoTrackAdapterSettings(const VideoTrackAdapterSettings& other);
+ VideoTrackAdapterSettings& operator=(const VideoTrackAdapterSettings& other);
int max_width;
int max_height;
double min_aspect_ratio;
double max_aspect_ratio;
double max_frame_rate;
+ // If supplied, this can be used to detect frames from a rotated device.
+ base::Optional<gfx::Size> expected_native_size;
};
// VideoTrackAdapter is a helper class used by MediaStreamVideoSource used for
@@ -76,7 +83,8 @@ class VideoTrackAdapter
const OnMutedCallback& on_muted_callback);
void StopFrameMonitoring();
- static void CalculateTargetSize(const gfx::Size& input_size,
+ static void CalculateTargetSize(bool is_rotated,
+ const gfx::Size& input_size,
const gfx::Size& max_frame_size,
double min_aspect_ratio,
double max_aspect_ratio,
« no previous file with comments | « content/renderer/media/media_stream_video_track_unittest.cc ('k') | content/renderer/media/video_track_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698