Commit 70ee6f3a56f1221637f4238489741879584c6c9f
Committed by
Gerrit Code Review
Merge "Remove custom shader from video view example and change video file sample" into devel/master
Showing
3 changed files
with
1 additions
and
52 deletions
examples/video-view/video-view-example.cpp
| ... | ... | @@ -28,7 +28,7 @@ namespace |
| 28 | 28 | const int INIT_HEIGHT( 400 ); |
| 29 | 29 | const int BUTTON_SIZE( 80 ); |
| 30 | 30 | |
| 31 | - const char* const PLAY_FILE = DEMO_VIDEO_DIR "big_buck_bunny.mp4"; | |
| 31 | + const char* const PLAY_FILE = DEMO_VIDEO_DIR "demoVideo.mp4"; | |
| 32 | 32 | const char* const PLAY_IMAGE = DEMO_IMAGE_DIR "icon-play.png"; |
| 33 | 33 | const char* const PAUSE_IMAGE = DEMO_IMAGE_DIR "Pause.png"; |
| 34 | 34 | const char* const STOP_IMAGE = DEMO_IMAGE_DIR "icon-stop.png"; |
| ... | ... | @@ -36,32 +36,6 @@ namespace |
| 36 | 36 | const char* const FORWARD_IMAGE = DEMO_IMAGE_DIR "Forward.png"; |
| 37 | 37 | const char* const BACKWARD_IMAGE = DEMO_IMAGE_DIR "Backward.png"; |
| 38 | 38 | |
| 39 | -const char* DEFAULT_FRAGMENT_SHADER = DALI_COMPOSE_SHADER( | |
| 40 | - varying mediump vec2 vTexCoord;\n | |
| 41 | - uniform sampler2D sTexture;\n | |
| 42 | - uniform lowp vec4 uColor;\n | |
| 43 | - \n | |
| 44 | - void main()\n | |
| 45 | - {\n | |
| 46 | - gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n | |
| 47 | - }\n | |
| 48 | -); | |
| 49 | - | |
| 50 | -const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( | |
| 51 | - precision mediump float; | |
| 52 | - varying mediump vec2 vTexCoord;\n | |
| 53 | - uniform sampler2D sTexture;\n | |
| 54 | - uniform lowp vec4 uColor;\n | |
| 55 | - \n | |
| 56 | - void main()\n | |
| 57 | - {\n | |
| 58 | - vec2 st = vTexCoord.st;\n | |
| 59 | - vec3 irgb = texture2D( sTexture, st ).rgb;\n | |
| 60 | - vec3 negative = vec3( 1., 1., 1. ) - irgb;\n | |
| 61 | - gl_FragColor = vec4( mix( irgb, negative, 1.0), 1. ) * uColor;\n | |
| 62 | - }\n | |
| 63 | -); | |
| 64 | - | |
| 65 | 39 | } // namespace |
| 66 | 40 | |
| 67 | 41 | class VideoViewController: public ConnectionTracker |
| ... | ... | @@ -73,7 +47,6 @@ class VideoViewController: public ConnectionTracker |
| 73 | 47 | mIsPlay( false ), |
| 74 | 48 | mIsStop( false ), |
| 75 | 49 | mIsFullScreen( false ), |
| 76 | - mSetCustomShader( false ), | |
| 77 | 50 | mScale( 1.f ) |
| 78 | 51 | { |
| 79 | 52 | // Connect to the Application's Init signal |
| ... | ... | @@ -209,16 +182,6 @@ class VideoViewController: public ConnectionTracker |
| 209 | 182 | |
| 210 | 183 | Stage::GetCurrent().KeyEventSignal().Connect( this, &VideoViewController::OnKeyEvent ); |
| 211 | 184 | |
| 212 | - Property::Map customShader; | |
| 213 | - customShader.Insert( Visual::Shader::Property::FRAGMENT_SHADER, FRAGMENT_SHADER ); | |
| 214 | - mCustomShader.Insert( Visual::Property::TYPE, Visual::IMAGE ); | |
| 215 | - mCustomShader.Insert( Visual::Property::SHADER, customShader ); | |
| 216 | - | |
| 217 | - Property::Map defaultShader; | |
| 218 | - customShader.Insert( Visual::Shader::Property::FRAGMENT_SHADER, DEFAULT_FRAGMENT_SHADER ); | |
| 219 | - mDefaultShader.Insert( Visual::Property::TYPE, Visual::IMAGE ); | |
| 220 | - mDefaultShader.Insert( Visual::Property::SHADER, customShader ); | |
| 221 | - | |
| 222 | 185 | mWindowSurfaceTarget.Insert( "RENDERING_TARGET", "windowSurfaceTarget" ); |
| 223 | 186 | mNativeImageTarget.Insert( "RENDERING_TARGET", "nativeImageTarget" ); |
| 224 | 187 | |
| ... | ... | @@ -350,17 +313,6 @@ class VideoViewController: public ConnectionTracker |
| 350 | 313 | if( !mIsFullScreen ) |
| 351 | 314 | { |
| 352 | 315 | mRotationAnimation.Play(); |
| 353 | - | |
| 354 | - if( mSetCustomShader ) | |
| 355 | - { | |
| 356 | - mSetCustomShader = false; | |
| 357 | - mVideoView.SetProperty( VideoView::Property::VIDEO, mDefaultShader ); | |
| 358 | - } | |
| 359 | - else | |
| 360 | - { | |
| 361 | - mSetCustomShader = true; | |
| 362 | - mVideoView.SetProperty( VideoView::Property::VIDEO, mCustomShader ); | |
| 363 | - } | |
| 364 | 316 | } |
| 365 | 317 | } |
| 366 | 318 | |
| ... | ... | @@ -389,7 +341,6 @@ private: |
| 389 | 341 | bool mIsPlay; |
| 390 | 342 | bool mIsStop; |
| 391 | 343 | bool mIsFullScreen; |
| 392 | - bool mSetCustomShader; | |
| 393 | 344 | |
| 394 | 345 | PushButton mPlayButton; |
| 395 | 346 | PushButton mPauseButton; |
| ... | ... | @@ -405,8 +356,6 @@ private: |
| 405 | 356 | float mPinchStartScale; |
| 406 | 357 | |
| 407 | 358 | Animation mRotationAnimation; |
| 408 | - Property::Map mCustomShader; | |
| 409 | - Property::Map mDefaultShader; | |
| 410 | 359 | Property::Map mWindowSurfaceTarget; |
| 411 | 360 | Property::Map mNativeImageTarget; |
| 412 | 361 | }; | ... | ... |
resources/videos/big_buck_bunny.mp4 deleted
No preview for this file type
resources/videos/demoVideo.mp4
0 → 100755
No preview for this file type