Exemple #1
0
bool PrivateDecoderMPEG2::Reset(void)
{
    if (mpeg2dec)
        mpeg2_reset(mpeg2dec, 0);
    ClearFrames();
    return true;
}
Exemple #2
0
void
ImageLoader::DropDocumentReference()
{
  ClearFrames();
  mImages.EnumerateEntries(&ClearImageHashSet, mDocument);
  mDocument = nullptr;
}
Exemple #3
0
PrivateDecoderMPEG2::~PrivateDecoderMPEG2()
{
    if (mpeg2dec)
        mpeg2_close(mpeg2dec);
    mpeg2dec = NULL;
    ClearFrames();
}
Exemple #4
0
void
ImageLoader::DropDocumentReference()
{
  // It's okay if GetPresContext returns null here (due to the presshell pointer
  // on the document being null) as that means the presshell has already
  // been destroyed, and it also calls ClearFrames when it is destroyed.
  ClearFrames(GetPresContext());
  mImages.EnumerateEntries(&ClearImageHashSet, mDocument);
  mDocument = nullptr;
}
void
FrameBlender::Discard()
{
    MOZ_ASSERT(NS_IsMainThread());

    // As soon as an image becomes animated, it becomes non-discardable and any
    // timers are cancelled.
    NS_ABORT_IF_FALSE(!mAnim, "Asked to discard for animated image!");

    // Delete all the decoded frames, then clear the array.
    ClearFrames();
}
Exemple #6
0
void FileTabsExample::OnAllAlign()
{
	if (allalign) {
		for (int i = 1; i < 4; i++)
			AddFrame(bar[i]);
	}
	else {
		for (int i = 0; i < 4; i++)
			bar[i].Remove();			
		ClearFrames();
		AddFrame(bar[0]);
	}
}
Exemple #7
0
bool PrivateDecoderMPEG2::Init(const QString &decoder,
                               bool no_hardware_decode,
                               AVCodecContext *avctx)
{
    if (!((decoder == "libmpeg2") &&
        (CODEC_IS_MPEG(avctx->codec_id))))
        return false;

    if (mpeg2dec)
        mpeg2_close(mpeg2dec);
    ClearFrames();
    mpeg2dec = mpeg2_init();
    if (mpeg2dec)
    {
        VERBOSE(VB_PLAYBACK, LOC + "Using libmpeg2 for video decoding");
        return true;
    }
    return false;
}
ScreamerNode::ScreamerNode(int number)
{
	m_number			  =	number;

	m_state				  =	WAIT;
	m_renderstate   = REQ_BATCH;
	m_waitreply		  =	false;
	
	char buffer[64];
	sprintf(buffer,"%d",number+1);

	m_config			  =	options->ScreamerConfigDir + "LW3.cfg";
	m_job					  =	(options->CommandDirectory + "job") + buffer;
	m_ack					  =	(options->CommandDirectory + "ack") + buffer;

	m_start				  =	0;
	m_end					  =	0;
	m_step				  =	0;

	ClearFrames();

	SetAvailable(false);
}
void ScreamerNode::Update(void)
{
	switch(m_state){
		case WAIT:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "wait";

				m_jobfile.close();

				SetAvailable(true);
			}else{
				if(ReadReply(WAIT) == true){
					m_waitreply = false;
				}
			}
		}break;

		case INIT:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "init";

				m_jobfile.close();

				SetAvailable(false);
			}else{
				if(ReadReply(INIT) == true){
					m_waitreply = false;
					m_state			= CONTENT;
				}
			}
		}break;

		case CONTENT:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);


				m_jobfile << "content " << m_contentdir << std::endl;

				m_jobfile.close();
			}else{
				if(ReadReply(CONTENT) == true){
					m_waitreply = false;
					m_state			= LOAD;
				}
			}
		}break;

		case LOAD:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "load" << std::endl << m_scenefile;

				m_jobfile.close();
			}else{
				if(ReadReply(LOAD) == true){
					m_waitreply	=	false;

					m_state			=	RENDERWAIT;
				}
			}
		}break;

		case RENDERWAIT:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "wait";

				m_jobfile.close();
			}else{
				if(ReadReply(WAIT) == true){
					switch(m_renderstate){
						case REQ_BATCH:{
							m_scene->RequestBatch(m_start,m_end,m_step);

							m_state				=	RENDER;
							m_renderstate = RENDERING;
	
							SetFrames();

							m_waitreply = false;

							if(m_start == SCENE_COMPLETE){
								SetAvailable(true);

								ClearScene();
								ClearFrames();

								m_state	= WAIT;
							}
						}break;

						case RENDERING:{
							m_scene->FrameComplete();
							scene_view->Update(m_scene->GetID());

							if(m_start >= m_end){
								m_renderstate = REQ_BATCH;
							}else{
								m_waitreply	= false;

								m_state	=	RENDER;

								m_start++;
							}
						}
					};
				}
			}
		}break;

		case RENDERPAUSE:{
			if(m_waitreply == false){
				m_waitreply = true;
			}else{
				m_waitreply = false;
			}
		}break;

		case RENDER:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "render " << m_start << " " << m_start << " " << m_step;

				m_jobfile.close();
			}else{

				if(ReadReply(RENDER) == true){
					m_waitreply	= false;
					m_state			= RENDERWAIT;
				}
			}
		}break;


	};

	screamer_view->Update(m_number);
}
FrameSequence::~FrameSequence()
{
  ClearFrames();
}