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

Side by Side Diff: media/tools/player_x11/gles_video_renderer.cc

Issue 3014059: media: recycle buffers/direct rendering etc. (third patch) (Closed)
Patch Set: code review Created 10 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 unified diff | Download patch
« no previous file with comments | « media/filters/video_renderer_base_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "media/tools/player_x11/gles_video_renderer.h" 5 #include "media/tools/player_x11/gles_video_renderer.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 #include <EGL/eglext.h> 8 #include <EGL/eglext.h>
9 #include <X11/Xutil.h> 9 #include <X11/Xutil.h>
10 #include <X11/extensions/Xrender.h> 10 #include <X11/extensions/Xrender.h>
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 memset(strides, 0, sizeof(strides)); 439 memset(strides, 0, sizeof(strides));
440 media::VideoFrame:: CreateFrameExternal( 440 media::VideoFrame:: CreateFrameExternal(
441 media::VideoFrame::TYPE_EGL_IMAGE, 441 media::VideoFrame::TYPE_EGL_IMAGE,
442 media::VideoFrame::RGB565, 442 media::VideoFrame::RGB565,
443 width(), height(), 3, 443 width(), height(), 3,
444 data, strides, 444 data, strides,
445 kZero, kZero, 445 kZero, kZero,
446 egl_image, 446 egl_image,
447 &video_frame); 447 &video_frame);
448 egl_frames_.push_back(std::make_pair(video_frame, texture)); 448 egl_frames_.push_back(std::make_pair(video_frame, texture));
449 GetDecoder()->FillThisBuffer(video_frame); 449 ReadInput(video_frame);
450 } 450 }
451 451
452 GLuint program = glCreateProgram(); 452 GLuint program = glCreateProgram();
453 453
454 // Create shader for EGL image 454 // Create shader for EGL image
455 CreateShader(program, GL_VERTEX_SHADER, 455 CreateShader(program, GL_VERTEX_SHADER,
456 kVertexShader, sizeof(kVertexShader)); 456 kVertexShader, sizeof(kVertexShader));
457 CreateShader(program, GL_FRAGMENT_SHADER, 457 CreateShader(program, GL_FRAGMENT_SHADER,
458 kFragmentShaderEgl, sizeof(kFragmentShaderEgl)); 458 kFragmentShaderEgl, sizeof(kFragmentShaderEgl));
459 LinkProgram(program); 459 LinkProgram(program);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 514
515 int pos_location = glGetAttribLocation(program, "in_pos"); 515 int pos_location = glGetAttribLocation(program, "in_pos");
516 glEnableVertexAttribArray(pos_location); 516 glEnableVertexAttribArray(pos_location);
517 glVertexAttribPointer(pos_location, 2, GL_FLOAT, GL_FALSE, 0, kVertices); 517 glVertexAttribPointer(pos_location, 2, GL_FLOAT, GL_FALSE, 0, kVertices);
518 518
519 int tc_location = glGetAttribLocation(program, "in_tc"); 519 int tc_location = glGetAttribLocation(program, "in_tc");
520 glEnableVertexAttribArray(tc_location); 520 glEnableVertexAttribArray(tc_location);
521 glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0, 521 glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0,
522 kTextureCoords); 522 kTextureCoords);
523 } 523 }
OLDNEW
« no previous file with comments | « media/filters/video_renderer_base_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698