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

Unified Diff: media/gpu/avda_shared_state.cc

Issue 2351293003: Relocate SurfaceTexture usage from AVDA GLImage into shared state. (Closed)
Patch Set: Const. Created 4 years, 3 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
« media/gpu/avda_codec_image.cc ('K') | « media/gpu/avda_shared_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/avda_shared_state.cc
diff --git a/media/gpu/avda_shared_state.cc b/media/gpu/avda_shared_state.cc
index 12b25256fabf2e4ac2a9c84ec0ef1dcea54730ea..40fd3a04d8b40f0204f44cc18e58ea3677753e3c 100644
--- a/media/gpu/avda_shared_state.cc
+++ b/media/gpu/avda_shared_state.cc
@@ -16,7 +16,14 @@ namespace media {
AVDASharedState::AVDASharedState()
: surface_texture_service_id_(0),
frame_available_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
- base::WaitableEvent::InitialState::NOT_SIGNALED) {}
+ base::WaitableEvent::InitialState::NOT_SIGNALED),
+
+ gl_matrix_{
+ 1, 0, 0, 0, // Default to a sane guess of "flip Y", just in case we
+ 0, -1, 0, 0, // can't get the matrix on the first call.
+ 0, 0, 1, 0, //
+ 0, 1, 0, 1, // Comment preserves 4x4 formatting.
+ } {}
AVDASharedState::~AVDASharedState() {
if (!surface_texture_service_id_)
@@ -107,4 +114,14 @@ void AVDASharedState::RenderCodecBufferToSurfaceTexture(
release_time_ = base::TimeTicks::Now();
}
+void AVDASharedState::UpdateTexImage() {
+ surface_texture_->UpdateTexImage();
+ // Helpfully, this is already column major.
+ surface_texture_->GetTransformMatrix(gl_matrix_);
+}
+
+void AVDASharedState::GetTransformMatrix(float matrix[16]) const {
+ memcpy(matrix, gl_matrix_, sizeof(gl_matrix_));
+}
+
} // namespace media
« media/gpu/avda_codec_image.cc ('K') | « media/gpu/avda_shared_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698