aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmedia')
-rw-r--r--linden/indra/llmedia/llmediaimplllmozlib.cpp2
-rw-r--r--linden/indra/llmedia/llmediaimplquicktime.cpp35
-rw-r--r--linden/indra/llmedia/llmediaobserver.h11
3 files changed, 31 insertions, 17 deletions
diff --git a/linden/indra/llmedia/llmediaimplllmozlib.cpp b/linden/indra/llmedia/llmediaimplllmozlib.cpp
index 5efaa59..53cb344 100644
--- a/linden/indra/llmedia/llmediaimplllmozlib.cpp
+++ b/linden/indra/llmedia/llmediaimplllmozlib.cpp
@@ -289,7 +289,7 @@ void LLMediaImplLLMozLib::onPageChanged( const EventType& eventIn )
289// virtual 289// virtual
290void LLMediaImplLLMozLib::onClickLinkHref( const EventType& eventIn ) 290void LLMediaImplLLMozLib::onClickLinkHref( const EventType& eventIn )
291{ 291{
292 LLMediaEvent event( this, eventIn.getStringValue() ); 292 LLMediaEvent event( this, eventIn.getStringValue(), eventIn.getStringValue2() );
293 mEventEmitter.update( &LLMediaObserver::onClickLinkHref, event ); 293 mEventEmitter.update( &LLMediaObserver::onClickLinkHref, event );
294} 294}
295 295
diff --git a/linden/indra/llmedia/llmediaimplquicktime.cpp b/linden/indra/llmedia/llmediaimplquicktime.cpp
index f9a3b05..b126e2f 100644
--- a/linden/indra/llmedia/llmediaimplquicktime.cpp
+++ b/linden/indra/llmedia/llmediaimplquicktime.cpp
@@ -256,17 +256,6 @@ bool LLMediaImplQuickTime::sizeChanged()
256 SetMovieGWorld( mMovieHandle, mGWorldHandle, GetGWorldDevice ( mGWorldHandle ) ); 256 SetMovieGWorld( mMovieHandle, mGWorldHandle, GetGWorldDevice ( mGWorldHandle ) );
257 } 257 }
258 258
259 // flip movie to match the way the client expects textures (sigh!)
260 MatrixRecord transform;
261 SetIdentityMatrix( &transform ); // transforms are additive so start from identify matrix
262 double scaleX = 1.0 / (double)LLMediaManager::textureWidthFromMediaWidth( width );
263 double scaleY = -1.0 / (double)LLMediaManager::textureHeightFromMediaHeight( height );
264 double centerX = width / 2.0;
265 double centerY = height / 2.0;
266 ScaleMatrix( &transform, X2Fix ( scaleX ), X2Fix ( scaleY ), X2Fix ( centerX ), X2Fix ( centerY ) );
267 SetMovieMatrix( mMovieHandle, &transform );
268 std::cout << "LLMEDIA> Flipping stream to match expected OpenGL orientation size=" << width << " x " << height << std::endl;
269
270 // update movie controller 259 // update movie controller
271 if ( mMovieController ) 260 if ( mMovieController )
272 { 261 {
@@ -454,10 +443,14 @@ bool LLMediaImplQuickTime::processState()
454bool LLMediaImplQuickTime::setMovieBoxEnhanced( Rect* rect ) 443bool LLMediaImplQuickTime::setMovieBoxEnhanced( Rect* rect )
455{ 444{
456 // get movie rect 445 // get movie rect
457 GetMovieBox( mMovieHandle, rect ); 446 GetMovieNaturalBoundsRect( mMovieHandle, rect );
458 int width = ( rect->right - rect->left ); 447
459 int height = ( rect->bottom - rect->top ); 448 int natural_width = ( rect->right - rect->left );
449 int natural_height = ( rect->bottom - rect->top );
460 450
451 int width = natural_width;
452 int height = natural_height;
453
461 // if the user has requested a specific size, use it: 454 // if the user has requested a specific size, use it:
462 if ((mMediaRequestedWidth != 0) && (mMediaRequestedHeight != 0)) 455 if ((mMediaRequestedWidth != 0) && (mMediaRequestedHeight != 0))
463 { 456 {
@@ -485,12 +478,22 @@ bool LLMediaImplQuickTime::setMovieBoxEnhanced( Rect* rect )
485 if ( height > mMaxHeight ) 478 if ( height > mMaxHeight )
486 height = mMaxHeight; 479 height = mMaxHeight;
487 480
488 // tell quicktime about new size 481
482 // scale movie to fit rect and invert vertically to match opengl image format
483 MatrixRecord transform;
484 SetIdentityMatrix( &transform ); // transforms are additive so start from identify matrix
485 double scaleX = (double) width / natural_width;
486 double scaleY = -1.0 * (double) height / natural_height;
487 double centerX = width / 2.0;
488 double centerY = height / 2.0;
489 ScaleMatrix( &transform, X2Fix ( scaleX ), X2Fix ( scaleY ), X2Fix ( centerX ), X2Fix ( centerY ) );
490 SetMovieMatrix( mMovieHandle, &transform );
491
492 // return the new rect
489 rect->right = width; 493 rect->right = width;
490 rect->bottom = height; 494 rect->bottom = height;
491 rect->left = 0; 495 rect->left = 0;
492 rect->top = 0; 496 rect->top = 0;
493 SetMovieBox( mMovieHandle, rect );
494 497
495 return true; 498 return true;
496} 499}
diff --git a/linden/indra/llmedia/llmediaobserver.h b/linden/indra/llmedia/llmediaobserver.h
index aeb2c39..ec9f881 100644
--- a/linden/indra/llmedia/llmediaobserver.h
+++ b/linden/indra/llmedia/llmediaobserver.h
@@ -47,6 +47,11 @@ class LLMediaEvent
47 { 47 {
48 }; 48 };
49 49
50 LLMediaEvent( LLMediaBase* subject, std::string string_in, std::string string_ex_in ) :
51 mSubject( subject ), mStringValue(string_in), mStringValueEx(string_ex_in)
52 {
53 };
54
50 LLMediaEvent( LLMediaBase* subject, std::string string_in, int int_in ) : 55 LLMediaEvent( LLMediaBase* subject, std::string string_in, int int_in ) :
51 mSubject( subject ), mStringValue(string_in), mIntValue(int_in) 56 mSubject( subject ), mStringValue(string_in), mIntValue(int_in)
52 { 57 {
@@ -74,10 +79,16 @@ class LLMediaEvent
74 return mStringValue; 79 return mStringValue;
75 } 80 }
76 81
82 std::string getStringValueEx() const
83 {
84 return mStringValueEx;
85 }
86
77 private: 87 private:
78 LLMediaBase* mSubject; 88 LLMediaBase* mSubject;
79 int mIntValue; 89 int mIntValue;
80 std::string mStringValue; 90 std::string mStringValue;
91 std::string mStringValueEx;
81}; 92};
82 93
83class LLMediaObserver 94class LLMediaObserver