diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 19:33:06 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 19:33:06 +0000 |
commit | 0b2765e449455ccd543d829df055a61fb3001108 (patch) | |
tree | b2f2ce06322cf869b400337c6759b91fa3f9438d /media | |
parent | 75d50f7e453213f4c3634d4990598fc19c8e6bc1 (diff) | |
download | chromium_src-0b2765e449455ccd543d829df055a61fb3001108.zip chromium_src-0b2765e449455ccd543d829df055a61fb3001108.tar.gz chromium_src-0b2765e449455ccd543d829df055a61fb3001108.tar.bz2 |
media player cleanup of old unused menu items
BUG=17415
TEST=options menu has no greyed out items in it. about box date updated.
Review URL: http://codereview.chromium.org/164334
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/player/mainfrm.h | 29 | ||||
-rw-r--r-- | media/player/movie.cc | 30 | ||||
-rw-r--r-- | media/player/movie.h | 14 | ||||
-rw-r--r-- | media/player/player_wtl.rc | 17 | ||||
-rw-r--r-- | media/player/resource.h | 2 | ||||
-rw-r--r-- | media/player/view.h | 48 |
6 files changed, 9 insertions, 131 deletions
diff --git a/media/player/mainfrm.h b/media/player/mainfrm.h index b20b172..a334fec 100644 --- a/media/player/mainfrm.h +++ b/media/player/mainfrm.h @@ -100,13 +100,7 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>, UIEnable(ID_PLAY_QUADRUPLESPEED, true); UIEnable(ID_PLAY_EIGHTSPEED, true); UIEnable(ID_PLAY_SIXTEENSPEED, true); -#ifdef _OPENMP - UIEnable(ID_OPTIONS_OPENMP, true); -#else - UIEnable(ID_OPTIONS_OPENMP, false); -#endif UIEnable(ID_OPTIONS_EXIT, true); // Not currently implemented. - UIEnable(ID_OPTIONS_SWSCALER, true); UIEnable(ID_OPTIONS_DRAW, true); UIEnable(ID_OPTIONS_AUDIO, !bMovieOpen); // Disable while playing. UIEnable(ID_OPTIONS_DUMPYUVFILE, true); @@ -238,9 +232,7 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>, COMMAND_RANGE_HANDLER_EX(ID_PLAY_HALFSPEED, ID_PLAY_SIXTEENSPEED, OnPlaySpeed) COMMAND_ID_HANDLER_EX(ID_APP_ABOUT, OnAppAbout) - COMMAND_ID_HANDLER_EX(ID_OPTIONS_OPENMP, OnOptionsOpenMP) COMMAND_ID_HANDLER_EX(ID_OPTIONS_EXIT, OnOptionsExit) - COMMAND_ID_HANDLER_EX(ID_OPTIONS_SWSCALER, OnOptionsSWScaler) COMMAND_ID_HANDLER_EX(ID_OPTIONS_DRAW, OnOptionsDraw) COMMAND_ID_HANDLER_EX(ID_OPTIONS_AUDIO, OnOptionsAudio) COMMAND_ID_HANDLER_EX(ID_OPTIONS_DUMPYUVFILE, OnOptionsDumpYUVFile) @@ -285,9 +277,7 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>, UPDATE_ELEMENT(ID_PLAY_QUADRUPLESPEED, UPDUI_MENUPOPUP) UPDATE_ELEMENT(ID_PLAY_EIGHTSPEED, UPDUI_MENUPOPUP) UPDATE_ELEMENT(ID_PLAY_SIXTEENSPEED, UPDUI_MENUPOPUP) - UPDATE_ELEMENT(ID_OPTIONS_OPENMP, UPDUI_MENUPOPUP) UPDATE_ELEMENT(ID_OPTIONS_EXIT, UPDUI_MENUPOPUP) - UPDATE_ELEMENT(ID_OPTIONS_SWSCALER, UPDUI_MENUPOPUP) UPDATE_ELEMENT(ID_OPTIONS_DRAW, UPDUI_MENUPOPUP) UPDATE_ELEMENT(ID_OPTIONS_AUDIO, UPDUI_MENUPOPUP) UPDATE_ELEMENT(ID_OPTIONS_DUMPYUVFILE, UPDUI_MENUPOPUP) @@ -376,15 +366,12 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>, UISetCheck(ID_VIEW_TOOLBAR, 1); UISetCheck(ID_VIEW_STATUS_BAR, 1); UISetCheck(ID_VIEW_ROTATE0, 1); - UISetCheck(ID_OPTIONS_OPENMP, 0); UISetCheck(ID_OPTIONS_EXIT, 0); UISetCheck(ID_OPTIONS_DRAW, 1); UISetCheck(ID_OPTIONS_AUDIO, 1); UpdateSizeUICheck(); UpdateSpeedUICheck(); - OnOptionsOpenMP(0, 0, 0); // Toggle openmp off on init. - CMessageLoop* pLoop = g_module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); @@ -684,15 +671,6 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>, UpdateLayout(); } - void OnOptionsOpenMP(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) { -#ifdef _OPENMP - bool enable_openmp = !media::Movie::get()->GetOpenMpEnable(); - media::Movie::get()->SetOpenMpEnable(enable_openmp); - UISetCheck(ID_OPTIONS_OPENMP, enable_openmp); -#endif - UpdateLayout(); - } - void OnOptionsExit(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) { // TODO(fbarchard): Implement when pipeline exposes properties. enable_exit = !enable_exit; @@ -700,13 +678,6 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>, UpdateLayout(); } - void OnOptionsSWScaler(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) { - bool enable_swscaler = !media::Movie::get()->GetSwscalerEnable(); - media::Movie::get()->SetSwscalerEnable(enable_swscaler); - UISetCheck(ID_OPTIONS_SWSCALER, enable_swscaler); - UpdateLayout(); - } - void OnOptionsDraw(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) { bool enable_draw = !media::Movie::get()->GetDrawEnable(); media::Movie::get()->SetDrawEnable(enable_draw); diff --git a/media/player/movie.cc b/media/player/movie.cc index 7f13f24..fbd208f 100644 --- a/media/player/movie.cc +++ b/media/player/movie.cc @@ -2,10 +2,6 @@ // source code is governed by a BSD-style license that can be found in the // LICENSE file. -#ifdef _OPENMP -#include <omp.h> -#endif - #include "base/at_exit.h" #include "base/string_util.h" #include "media/base/factory.h" @@ -34,11 +30,9 @@ namespace media { Movie::Movie() : enable_audio_(true), - enable_swscaler_(false), enable_draw_(true), enable_dump_yuv_file_(false), enable_pause_(false), - enable_openmp_(false), max_threads_(0), play_rate_(1.0f), movie_dib_(NULL), @@ -161,14 +155,6 @@ bool Movie::GetDrawEnable() { return enable_draw_; } -void Movie::SetSwscalerEnable(bool enable_swscaler) { - enable_swscaler_ = enable_swscaler; -} - -bool Movie::GetSwscalerEnable() { - return enable_swscaler_; -} - void Movie::SetDumpYuvFileEnable(bool enable_dump_yuv_file) { enable_dump_yuv_file_ = enable_dump_yuv_file; } @@ -177,22 +163,6 @@ bool Movie::GetDumpYuvFileEnable() { return enable_dump_yuv_file_; } -// Enable/Disable OpenMP. -void Movie::SetOpenMpEnable(bool enable_openmp) { -#ifdef _OPENMP - if (!max_threads_) - max_threads_ = omp_get_max_threads(); - - enable_openmp_ = enable_openmp; - omp_set_num_threads(enable_openmp_ ? max_threads_ : 1); -#endif -} - -// Get Enable/Disable OpenMP state. -bool Movie::GetOpenMpEnable() { - return enable_openmp_; -} - // Teardown. void Movie::Close() { if (pipeline_) { diff --git a/media/player/movie.h b/media/player/movie.h index ac8fba1..7c0b034 100644 --- a/media/player/movie.h +++ b/media/player/movie.h @@ -66,24 +66,12 @@ class Movie : public Singleton<Movie> { // Get Enable/Disable draw state. bool GetDrawEnable(); - // Enable/Disable swscaler. - void SetSwscalerEnable(bool enable_swscaler); - - // Get Enable/Disable swscaler state. - bool GetSwscalerEnable(); - // Enable/Disable dump yuv file. void SetDumpYuvFileEnable(bool enable_dump_yuv_file); // Get Enable/Disable dump yuv file state. bool GetDumpYuvFileEnable(); - // Enable/Disable OpenMP. - void SetOpenMpEnable(bool enable_openmp); - - // Get Enable/Disable OpenMP state. - bool GetOpenMpEnable(); - private: // Only allow Singleton to create and delete Movie. friend struct DefaultSingletonTraits<Movie>; @@ -94,11 +82,9 @@ class Movie : public Singleton<Movie> { scoped_ptr<base::Thread> thread_; bool enable_audio_; - bool enable_swscaler_; bool enable_draw_; bool enable_dump_yuv_file_; bool enable_pause_; - bool enable_openmp_; int max_threads_; float play_rate_; HBITMAP movie_dib_; diff --git a/media/player/player_wtl.rc b/media/player/player_wtl.rc index 82bcbe2..68b892a 100644 --- a/media/player/player_wtl.rc +++ b/media/player/player_wtl.rc @@ -150,8 +150,6 @@ BEGIN MENUITEM "&Exit at End of Movie", ID_OPTIONS_EXIT MENUITEM "Draw", ID_OPTIONS_DRAW MENUITEM "Audio", ID_OPTIONS_AUDIO - MENUITEM "&OpenMP", ID_OPTIONS_OPENMP - MENUITEM "SWScaler", ID_OPTIONS_SWSCALER MENUITEM "Dump YUV File", ID_OPTIONS_DUMPYUVFILE END POPUP "&Help" @@ -193,7 +191,7 @@ CAPTION "About" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "OK",IDOK,121,97,50,14 - CTEXT "Media Player\n\nMay 14, 2009\n\nCopyright (c) 2009 The Chromium Authors.\nAll rights reserved.",IDC_STATIC,7,43,171,49 + CTEXT "Media Player\n\nAugust 11, 2009\n\nCopyright (c) 2009 The Chromium Authors.\nAll rights reserved.",IDC_STATIC,7,43,171,49 ICON IDR_MAINFRAME3,IDC_STATIC,80,17,20,20 GROUPBOX "",IDC_STATIC,7,7,171,112 END @@ -535,8 +533,6 @@ END STRINGTABLE BEGIN - ID_OPTIONS_OPENMP "Enable OpenMP for YUV" - ID_OPTIONS_SWSCALER "Use SWScaler YUV conversion" ID_OPTIONS_DRAW "Enable/Disable Draws" ID_OPTIONS_AUDIO "Enable/Disable Audio" ID_OPTIONS_DUMPYUVFILE "Dump YUV frames to a file" @@ -546,14 +542,3 @@ END ///////////////////////////////////////////////////////////////////////////// - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/media/player/resource.h b/media/player/resource.h index fd47fe4..4c4b643 100644 --- a/media/player/resource.h +++ b/media/player/resource.h @@ -32,8 +32,6 @@ #define ID_PLAY_PLAY 32781 #define ID_PLAY_PLAY_PAUSE 32782 #define ID_OPTIONS_EXIT 32840 -#define ID_OPTIONS_OPENMP 32790 -#define ID_OPTIONS_SWSCALER 32791 #define ID_OPTIONS_DRAW 32792 #define ID_OPTIONS_AUDIO 32793 #define ID_OPTIONS_DUMPYUVFILE 32794 diff --git a/media/player/view.h b/media/player/view.h index 9e99587..8a87dbb 100644 --- a/media/player/view.h +++ b/media/player/view.h @@ -19,10 +19,6 @@ #include <string.h> #endif -// Enable swscaler. -// TODO(fbarchard): Include header and change bilinear to point sampling. -// #define TEST_SWSCALER 1 - #include <atlscrl.h> #include "base/basictypes.h" @@ -213,42 +209,14 @@ class WtlVideoWindow : public CScrollWindowImpl<WtlVideoWindow> { bool enable_draw = media::Movie::get()->GetDrawEnable(); if (enable_draw) { -#ifdef TEST_SWSCALER - bool enable_swscaler = media::Movie::get()->GetSwscalerEnable(); - if (enable_swscaler) { - uint8* data_out[3]; - int stride_out[3]; - data_out[0] = movie_dib_bits; - data_out[1] = NULL; - data_out[2] = NULL; - stride_out[0] = dibrowbytes; - stride_out[1] = 0; - stride_out[2] = 0; - - if (!sws_context_) { - DCHECK(frame_in.format == VideoSurface::YV12); - sws_context_ = sws_getContext(frame_in.width, frame_in.height, - PIX_FMT_YUV420P, width_, height_, - PIX_FMT_RGB32, SWS_FAST_BILINEAR, - NULL, NULL, NULL); - DCHECK(sws_context_); - } - - sws_scale(sws_context_, frame_in.data, frame_in.strides, 0, - height_, data_out, stride_out); - } else { -#endif - DCHECK(bm.bmBitsPixel == 32); - DrawYUV(frame_in, - movie_dib_bits, - dibrowbytes, - clipped_width, - clipped_height, - scaled_width, - scaled_height); -#ifdef TEST_SWSCALER - } -#endif + DCHECK(bm.bmBitsPixel == 32); + DrawYUV(frame_in, + movie_dib_bits, + dibrowbytes, + clipped_width, + clipped_height, + scaled_width, + scaled_height); } #ifdef TESTING double yuv_time_end = GetTime(); |