Example #1
0
// virtual
void LLViewerMediaImpl::onMediaSizeChange(const EventType& event_in)
{
	LLMediaBase* media_source = event_in.getSubject();
	LLViewerImage* placeholder_image = gImageList.getImage( mMovieImageID );
	if (placeholder_image)
	{
		initializePlaceholderImage(placeholder_image, media_source);
	}
	else
	{
		llinfos << "no placeholder image" << llendl;
	}
}
Example #2
0
// virtual
void LLViewerMediaImpl::onMediaContentsChange(const EventType& event_in)
{
	LLMediaBase* media_source = event_in.getSubject();
	LLViewerImage* placeholder_image = gImageList.getImage( mMovieImageID );
	if ((placeholder_image) && (placeholder_image->getHasGLTexture()))
	{
		if (placeholder_image->getUseMipMaps())
		{
			// bad image!  NO MIPMAPS!
			initializePlaceholderImage(placeholder_image, media_source);
		}

		U8* data = media_source->getMediaData();
		S32 x_pos = 0;
		S32 y_pos = 0;
		S32 width = media_source->getMediaWidth();
		S32 height = media_source->getMediaHeight();
		S32 data_width = media_source->getMediaDataWidth();
		S32 data_height = media_source->getMediaDataHeight();
		placeholder_image->setSubImage(data, data_width, data_height,
			x_pos, y_pos, width, height);
	}
}