summaryrefslogtreecommitdiffstats
path: root/media/player
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-08 03:56:53 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-08 03:56:53 +0000
commit7091ca47e63c66e8f9f9b02508ea4cbc25ab3aff (patch)
tree0a0917e11f12a7e607eac702edd5eef574edc360 /media/player
parent51046488738f8a3fdd7f55fc046a93f89e0294f7 (diff)
downloadchromium_src-7091ca47e63c66e8f9f9b02508ea4cbc25ab3aff.zip
chromium_src-7091ca47e63c66e8f9f9b02508ea4cbc25ab3aff.tar.gz
chromium_src-7091ca47e63c66e8f9f9b02508ea4cbc25ab3aff.tar.bz2
Revert r15615, build errors on linux and mac.
Review URL: http://codereview.chromium.org/113135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/player')
-rw-r--r--media/player/mainfrm.h48
-rw-r--r--media/player/player_wtl.cc18
-rw-r--r--media/player/resource.h9
-rw-r--r--media/player/view.h123
4 files changed, 64 insertions, 134 deletions
diff --git a/media/player/mainfrm.h b/media/player/mainfrm.h
index 7874a01..e1c9978 100644
--- a/media/player/mainfrm.h
+++ b/media/player/mainfrm.h
@@ -77,12 +77,7 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
UIEnable(ID_VIEW_FITTOSCREEN, false); // Not currently implemented.
UIEnable(ID_VIEW_FULLSCREEN, false); // Not currently implemented.
UIEnable(ID_VIEW_PROPERTIES, bEnable);
- UIEnable(ID_VIEW_ROTATE0, true);
- UIEnable(ID_VIEW_ROTATE90, false);
- UIEnable(ID_VIEW_ROTATE180, true);
- UIEnable(ID_VIEW_ROTATE270, false);
- UIEnable(ID_VIEW_MIRROR_HORIZONTAL, true);
- UIEnable(ID_VIEW_MIRROR_VERTICAL, true);
+
UIEnable(ID_PLAY_PLAY_PAUSE, bMovieOpen); // if no movie open.
UIEnable(ID_PLAY_HALFSPEED, true);
UIEnable(ID_PLAY_NORMALSPEED, true);
@@ -212,8 +207,6 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
COMMAND_RANGE_HANDLER_EX(ID_VIEW_HALFSIZE, ID_VIEW_FULLSCREEN, OnViewSize)
COMMAND_ID_HANDLER_EX(ID_VIEW_TOOLBAR, OnViewToolBar)
COMMAND_ID_HANDLER_EX(ID_VIEW_STATUS_BAR, OnViewStatusBar)
- COMMAND_RANGE_HANDLER_EX(ID_VIEW_ROTATE0, ID_VIEW_MIRROR_VERTICAL,
- OnViewRotate)
COMMAND_ID_HANDLER_EX(ID_VIEW_PROPERTIES, OnViewProperties)
COMMAND_ID_HANDLER_EX(ID_PLAY_PLAY_PAUSE, OnPlayPlayPause)
COMMAND_RANGE_HANDLER_EX(ID_PLAY_HALFSPEED, ID_PLAY_DOUBLESPEED,
@@ -243,12 +236,6 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
UPDATE_ELEMENT(ID_VIEW_FULLSCREEN, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP)
- UPDATE_ELEMENT(ID_VIEW_ROTATE0, UPDUI_MENUPOPUP)
- UPDATE_ELEMENT(ID_VIEW_ROTATE90, UPDUI_MENUPOPUP)
- UPDATE_ELEMENT(ID_VIEW_ROTATE180, UPDUI_MENUPOPUP)
- UPDATE_ELEMENT(ID_VIEW_ROTATE270, UPDUI_MENUPOPUP)
- UPDATE_ELEMENT(ID_VIEW_MIRROR_HORIZONTAL, UPDUI_MENUPOPUP)
- UPDATE_ELEMENT(ID_VIEW_MIRROR_VERTICAL, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_VIEW_PROPERTIES, UPDUI_MENUPOPUP | UPDUI_TOOLBAR)
UPDATE_ELEMENT(ID_PLAY_PLAY_PAUSE, UPDUI_MENUPOPUP | UPDUI_TOOLBAR)
UPDATE_ELEMENT(ID_PLAY_HALFSPEED, UPDUI_MENUPOPUP)
@@ -273,22 +260,10 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
}
void UpdateSpeedUICheck() {
- if (media::Movie::get()) {
- float play_rate = media::Movie::get()->GetPlayRate();
- UISetCheck(ID_PLAY_HALFSPEED, (play_rate == 0.5f));
- UISetCheck(ID_PLAY_NORMALSPEED, (play_rate == 1.0f));
- UISetCheck(ID_PLAY_DOUBLESPEED, (play_rate == 2.0f));
- }
- }
-
- void UpdateRotateUICheck() {
- int view_rotate = m_view.GetViewRotate();
- UISetCheck(ID_VIEW_ROTATE0, (view_rotate == 0));
- UISetCheck(ID_VIEW_ROTATE90, (view_rotate == 1));
- UISetCheck(ID_VIEW_ROTATE180, (view_rotate == 2));
- UISetCheck(ID_VIEW_ROTATE270, (view_rotate == 3));
- UISetCheck(ID_VIEW_MIRROR_HORIZONTAL, (view_rotate == 4));
- UISetCheck(ID_VIEW_MIRROR_VERTICAL, (view_rotate == 5));
+ float play_rate = media::Movie::get()->GetPlayRate();
+ UISetCheck(ID_PLAY_HALFSPEED, (play_rate == 0.5f));
+ UISetCheck(ID_PLAY_NORMALSPEED, (play_rate == 1.0f));
+ UISetCheck(ID_PLAY_DOUBLESPEED, (play_rate == 2.0f));
}
int OnCreate(LPCREATESTRUCT /*lpCreateStruct*/) {
@@ -337,7 +312,6 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
UISetCheck(ID_PLAY_NORMALSPEED, 1);
UISetCheck(ID_VIEW_TOOLBAR, 1);
UISetCheck(ID_VIEW_STATUS_BAR, 1);
- UISetCheck(ID_VIEW_ROTATE0, 1);
UISetCheck(ID_OPTIONS_OPENMP, 0);
UISetCheck(ID_OPTIONS_DRAW, 1);
UISetCheck(ID_OPTIONS_AUDIO, 1);
@@ -416,9 +390,9 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
void OnFileOpen(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
CFileDialog dlg(TRUE, L"bmp", NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- L"Movie Files (*.mp4;*.ogg;*.ogv)\0"
- L"*.mp4;*.ogg;*.ogv\0"
- L"Audio Files (*.mp3;*.m4a)\0*.mp3;*.m4a\0All Files (*.*)\0*.*\0",
+ L"Movie Files (*.mp4;*.mov;*.mkv;*.flv;*.avi;*.264)\0"
+ L"*.mp4;*.mov;*.mkv;*.flv;*.avi;*.264\0"
+ L"Bitmap Files (*.bmp)\0*.bmp\0All Files (*.*)\0*.*\0",
m_hWnd);
if (dlg.DoModal() == IDOK) {
MovieOpenFile(dlg.m_szFileName);
@@ -563,12 +537,6 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
UpdateLayout();
}
- void OnViewRotate(UINT /*uNotifyCode*/, int nID, CWindow /*wnd*/) {
- m_view.SetViewRotate(nID - ID_VIEW_ROTATE0);
- UpdateRotateUICheck();
- UpdateLayout();
- }
-
void OnViewToolBar(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
static BOOL bNew = TRUE; // initially visible
bNew = !bNew;
diff --git a/media/player/player_wtl.cc b/media/player/player_wtl.cc
index 26cbaba..0c2bb6b 100644
--- a/media/player/player_wtl.cc
+++ b/media/player/player_wtl.cc
@@ -14,14 +14,14 @@
// Note this header must come before other ATL headers.
#include "media/player/stdafx.h"
-#include <atlcrack.h> // NOLINT
-#include <atlctrls.h> // NOLINT
-#include <atlctrlw.h> // NOLINT
-#include <atldlgs.h> // NOLINT
-#include <atlframe.h> // NOLINT
-#include <atlmisc.h> // NOLINT
-#include <atlprint.h> // NOLINT
-#include <atlscrl.h> // NOLINT
+#include <atlcrack.h>
+#include <atlctrls.h>
+#include <atlctrlw.h>
+#include <atldlgs.h>
+#include <atlframe.h>
+#include <atlmisc.h>
+#include <atlprint.h>
+#include <atlscrl.h>
// Note these headers are order sensitive.
#include "base/at_exit.h"
@@ -45,7 +45,6 @@
CAppModule g_module;
int Run(wchar_t* cmd_line, int cmd_show) {
- base::AtExitManager exit_manager;
CMessageLoop the_loop;
g_module.AddMessageLoop(&the_loop);
@@ -57,6 +56,7 @@ int Run(wchar_t* cmd_line, int cmd_show) {
wnd_main.ShowWindow(cmd_show);
+ base::AtExitManager exit_manager;
wchar_t* url = NULL;
if (cmd_line && *cmd_line) {
diff --git a/media/player/resource.h b/media/player/resource.h
index ee8f260..d009d7b 100644
--- a/media/player/resource.h
+++ b/media/player/resource.h
@@ -43,20 +43,13 @@
#define ID_PLAY_NORMALSPEED 32802
#define ID_PLAY_DOUBLESPEED 32803
#define ID_FILE_LAST 32804
-#define ID_Menu32806 32806
-#define ID_VIEW_ROTATE0 32807
-#define ID_VIEW_ROTATE90 32808
-#define ID_VIEW_ROTATE180 32809
-#define ID_VIEW_ROTATE270 32810
-#define ID_VIEW_MIRROR_HORIZONTAL 32811
-#define ID_VIEW_MIRROR_VERTICAL 32812
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 203
-#define _APS_NEXT_COMMAND_VALUE 32813
+#define _APS_NEXT_COMMAND_VALUE 32806
#define _APS_NEXT_CONTROL_VALUE 1013
#define _APS_NEXT_SYMED_VALUE 101
#endif
diff --git a/media/player/view.h b/media/player/view.h
index f515c16..4c72512 100644
--- a/media/player/view.h
+++ b/media/player/view.h
@@ -54,7 +54,6 @@ class WtlVideoWindow : public CScrollWindowImpl<WtlVideoWindow> {
size_.cx = 0;
size_.cy = 0;
view_size_ = 1;
- view_rotate_ = media::ROTATE_0;
renderer_ = new WtlVideoRenderer(this);
last_frame_ = NULL;
hbmp_ = NULL;
@@ -296,56 +295,6 @@ class WtlVideoWindow : public CScrollWindowImpl<WtlVideoWindow> {
return view_size_;
}
- void SetViewRotate(int view_rotate) {
- switch (view_rotate) {
- default:
- case 0:
- view_rotate_ = media::ROTATE_0;
- break;
- case 1:
- view_rotate_ = media::ROTATE_90;
- break;
- case 2:
- view_rotate_ = media::ROTATE_180;
- break;
- case 3:
- view_rotate_ = media::ROTATE_270;
- break;
- case 4:
- view_rotate_ = media::MIRROR_ROTATE_0;
- break;
- case 5:
- view_rotate_ = media::MIRROR_ROTATE_180;
- break;
- }
- }
-
- int GetViewRotate() {
- int view_rotate = 0;
- switch (view_rotate_) {
- default:
- case media::ROTATE_0:
- view_rotate = 0;
- break;
- case media::ROTATE_90:
- view_rotate = 1;
- break;
- case media::ROTATE_180:
- view_rotate = 2;
- break;
- case media::ROTATE_270:
- view_rotate = 3;
- break;
- case media::MIRROR_ROTATE_0:
- view_rotate = 4;
- break;
- case media::MIRROR_ROTATE_180:
- view_rotate = 5;
- break;
- }
- return view_rotate;
- }
-
void SetBitmap(HBITMAP hbmp) {
hbmp_ = hbmp;
}
@@ -358,9 +307,6 @@ class WtlVideoWindow : public CScrollWindowImpl<WtlVideoWindow> {
HBITMAP hbmp_; // For Images
int view_size_; // View Size. 0=0.5, 1=normal, 2=2x, 3=fit, 4=full
- // View Rotate 0-5 for ID_VIEW_ROTATE0 to ID_VIEW_MIRROR_VERTICAL
- media::Rotate view_rotate_;
-
// Draw a frame of YUV to an RGB buffer with scaling.
// Handles different YUV formats.
void DrawYUV(const media::VideoSurface &frame_in,
@@ -370,30 +316,53 @@ class WtlVideoWindow : public CScrollWindowImpl<WtlVideoWindow> {
int clipped_height,
int scaled_width,
int scaled_height) {
- if (frame_in.format == media::VideoSurface::YV16) {
- // Temporary cast, til we use uint8 for VideoFrame.
- media::ScaleYV16ToRGB32(frame_in.data[0],
- frame_in.data[1],
- frame_in.data[2],
- movie_dib_bits,
- clipped_width, clipped_height,
- scaled_width, scaled_height,
- frame_in.strides[0],
- frame_in.strides[1],
- dibrowbytes,
- view_rotate_);
+ // Normal size
+ if (view_size_ == 1) {
+ if (frame_in.format == media::VideoSurface::YV16) {
+ // Temporary cast, til we use uint8 for VideoFrame.
+ media::ConvertYV16ToRGB32((const uint8*)frame_in.data[0],
+ (const uint8*)frame_in.data[1],
+ (const uint8*)frame_in.data[2],
+ movie_dib_bits,
+ clipped_width, clipped_height,
+ frame_in.strides[0],
+ frame_in.strides[1],
+ dibrowbytes);
+ } else {
+ // Temporary cast, til we use uint8 for VideoFrame.
+ media::ConvertYV12ToRGB32((const uint8*)frame_in.data[0],
+ (const uint8*)frame_in.data[1],
+ (const uint8*)frame_in.data[2],
+ movie_dib_bits,
+ clipped_width, clipped_height,
+ frame_in.strides[0],
+ frame_in.strides[1],
+ dibrowbytes);
+ }
} else {
- // Temporary cast, til we use uint8 for VideoFrame.
- media::ScaleYV12ToRGB32(frame_in.data[0],
- frame_in.data[1],
- frame_in.data[2],
- movie_dib_bits,
- clipped_width, clipped_height,
- scaled_width, scaled_height,
- frame_in.strides[0],
- frame_in.strides[1],
- dibrowbytes,
- view_rotate_);
+ if (frame_in.format == media::VideoSurface::YV16) {
+ // Temporary cast, til we use uint8 for VideoFrame.
+ media::ScaleYV16ToRGB32((const uint8*)frame_in.data[0],
+ (const uint8*)frame_in.data[1],
+ (const uint8*)frame_in.data[2],
+ movie_dib_bits,
+ clipped_width, clipped_height,
+ scaled_width, scaled_height,
+ frame_in.strides[0],
+ frame_in.strides[1],
+ dibrowbytes);
+ } else {
+ // Temporary cast, til we use uint8 for VideoFrame.
+ media::ScaleYV12ToRGB32((const uint8*)frame_in.data[0],
+ (const uint8*)frame_in.data[1],
+ (const uint8*)frame_in.data[2],
+ movie_dib_bits,
+ clipped_width, clipped_height,
+ scaled_width, scaled_height,
+ frame_in.strides[0],
+ frame_in.strides[1],
+ dibrowbytes);
+ }
}
}