Пример #1
0
    int MP3InputStream::decodeFrames(int frames, void* samples)
    {
        int ret, rret;
        unsigned int len = frames * GetFrameSize(this);
        unsigned char *out = (unsigned char*)samples;
        size_t rb = 0, rv = 0;

        if (!mh) return 0;

        while (len > 0)
        {
            ret = mpg123_read(mh, out, len, &rv);
            rb += rv;
            out += rv;
            len -= rv;
            if (ret == MPG123_NEED_MORE)
            {
                // read the data
                m_input_length = m_file->read(m_input_buffer, INPUT_BUFFER_SIZE);
                if (m_input_length == 0) { m_eof = true; return true; }
                // feed it to mpg123
                rret = mpg123_feed(mh,m_input_buffer,m_input_length);
                if (rret != MPG123_OK) return false;    // something went wrong!
            }
        }

        return rb / GetFrameSize(this);
    }
Пример #2
0
/* static */ void
ES_NativeStackFrame::InitializeFrame(void *frame_start, ES_FrameStackIterator frame, void **&next_frame, BOOL include_return_address)
{
    ES_Code *code = frame.GetCode();
    ES_CodeWord *codeword = frame.GetCodeWord();

    void **ptr = reinterpret_cast<void **>(frame_start);

    if (include_return_address)
        *(ptr - GetFrameSize(code, TRUE) / sizeof(void *)) = GetReturnAddress(code, codeword);

    *next_frame = --ptr;
    next_frame = ptr;
    *--ptr = frame.GetRegisterFrame();
    *--ptr = code;
    *--ptr = frame.GetArgumentsObject();
#ifdef ARCHITECTURE_MIPS
    *--ptr = reinterpret_cast<void *>(static_cast<UINTPTR>(frame.GetArgumentsCount()));
#endif

    if (code->CanHaveVariableObject())
        *--ptr = frame.GetVariableObject();

#ifndef ARCHITECTURE_MIPS
    *--ptr = reinterpret_cast<void *>(static_cast<UINTPTR>(frame.GetArgumentsCount()));
#endif
}
Пример #3
0
sf::FloatRect
Animation::getLocalBounds() const {
    return sf::FloatRect(
        getOrigin(),
        static_cast<sf::Vector2f>( GetFrameSize() )
    );
}
Пример #4
0
HRESULT GetEncodingBitrate(IMFMediaType *pMediaType, UINT32 *uiEncodingBitrate)
{
    UINT32 uiWidth;
    UINT32 uiHeight;
    float uiBitrate;
    UINT32 uiFrameRateNum;
    UINT32 uiFrameRateDenom;

    HRESULT hr = GetFrameSize(pMediaType, &uiWidth, &uiHeight);
    if (FAILED(hr))
    {
        goto done;
    }

    hr = GetFrameRate(pMediaType, &uiFrameRateNum, &uiFrameRateDenom);
    if (FAILED(hr))
    {
        goto done;
    }

    uiBitrate = uiWidth / 3.0f * uiHeight * uiFrameRateNum / uiFrameRateDenom;
    
    *uiEncodingBitrate = (UINT32) uiBitrate;

done:

    return hr;
}
Пример #5
0
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
//		¥ CalcSubPaneRects
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// Returns the rectangles inside of this view which the two sub panes should occupy.
void CHexView::CalcSubPaneRects(
	Rect			&outHexRect,
	Rect			&outASCIIRect)
{
	SDimension16	frameSize;
	
	GetFrameSize(frameSize);
	
	if (frameSize.width>0)
	{
		UInt16		availableSpace=frameSize.width-kGapBetweenSubPanes-CHexEditorPane::kLeftIndent*2-CHexEditorPane::kRightIndent*2;		
		UInt16		fullBlocksPerRow=availableSpace/CHexEditorPane::k4ByteAsciiAndHexBlockPixelWidth;
		UInt16		halfBlocksPerRow=availableSpace%CHexEditorPane::k4ByteAsciiAndHexBlockPixelWidth;
		
		if (halfBlocksPerRow>=CHexEditorPane::k2ByteAsciiAndHexBlockPixelWidth)
			halfBlocksPerRow=1;
		else
			halfBlocksPerRow=0;
				
		FSetRect(outHexRect,0,0,frameSize.height,CHexEditorPane::kLeftIndent+CHexEditorPane::kRightIndent+fullBlocksPerRow*CHexEditorPane::k4ByteHexBlockPixelWidth+halfBlocksPerRow*CHexEditorPane::k2ByteHexBlockPixelWidth);
		FSetRect(outASCIIRect,0,0,frameSize.height,CHexEditorPane::kLeftIndent+CHexEditorPane::kRightIndent+fullBlocksPerRow*CHexEditorPane::k4ByteAsciiBlockPixelWidth+halfBlocksPerRow*CHexEditorPane::k2ByteAsciiBlockPixelWidth);
		
		// Align the ascii rect to the right hand side of the view
		outASCIIRect.left=frameSize.width-outASCIIRect.right;
		outASCIIRect.right=frameSize.width;
	}
	else
	{
		FSetRect(outHexRect,0,0,0,0);
		FSetRect(outASCIIRect,0,0,0,0);
	}	
}
Пример #6
0
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
//		¥ AdjustColToFrame
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
void CHierarchicalTable::AdjustColToFrame()
{
	SDimension16	frame;

	GetFrameSize(frame);

	inheritedTable::SetColWidth(frame.width,1,1);
}
Пример #7
0
bool GLSprite::Draw(
	const math::Vector2& v2Pos,
	const Color& color,
	const float angle,
	const math::Vector2& v2Scale)
{
	const math::Vector2 v2Size(GetFrameSize() * v2Scale);
	return DrawShaped(v2Pos, v2Size, color, color, color, color, angle);
}
Пример #8
0
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
//		¥ FinishCreateSelf										/*e*/
// ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
// Used to initialize the helper classes.
void CHierarchicalTable::FinishCreateSelf()
{
	SDimension16	frame;

	GetFrameSize(frame);

	SetTableGeometry(new CHierarchicalGeometry(this,frame.width,mRowHeight));
	SetTableSelector(new LTableMultiSelector(this));	

	InsertCols(1,0);
}
Пример #9
0
void FiniteStateCharacter::MoveToTopOfTile()
{
	//Moves the FiniteStateCharacter to the top of the tile below them

	//Get the maps tilesize
	int tileSize = map->GetTileSize();
	
	//Get the height of the current frame
	int frameHeight = GetFrameSize().Height;
	//Calculate the yIndex of the tile
	int tileY = (((location.Y + frameHeight) + velocity.Y)/tileSize);
	//Calculate the pixel location at the top of that tile
	int tileYTop = tileY * tileSize;
	//Set the y values of the location and hitbox
	hitbox.Y = (tileYTop - TWO) - hitbox.Height;
	location.Y = (tileYTop - TWO) - (hitbox.Height - yDeadzone);
}//End MoveToTopOfTile()
Пример #10
0
void
LGAMiniArrowPopup::FinishCreateSelf ()
{

	// е We are now going to check the size of the popup to ensure that
	// it is the size we require as we are setup up to be one specific
	// size
	SDimension16	frameSize;
	GetFrameSize ( frameSize );
	if ( frameSize.width != miniPopup_Width || frameSize.height != miniPopup_Height )
	{
		ResizeFrameTo ( miniPopup_Width, miniPopup_Height, false );
	}
	
	// е Make sure that the correct values are setup for the popup
	SetMacMenuH ( LoadPopupMenuH () );

}	//	LGAMiniArrowPopup::FinishCreateSelf
Пример #11
0
    bool MP3InputStream::decodeFrame()
    {
        const int frame_size = GetFrameSize(this);
        int ret, rret;
        size_t rv = 0;

        if (!mh) return false;

        while (rv < (size_t)frame_size)
        {
            ret = mpg123_read(mh, m_decode_buffer, frame_size, &rv);
            if (ret == MPG123_NEED_MORE)
            {
                // read the data
                m_input_length = m_file->read(m_input_buffer, INPUT_BUFFER_SIZE);
                if (m_input_length == 0) { m_eof = true; return true; }
                // feed it to mpg123
                rret = mpg123_feed(mh,m_input_buffer,m_input_length);
                if (rret != MPG123_OK) return false;    // something went wrong!
            }
        }


        if (m_first_frame)
        {
            int enc = 0;
            long int li;
            mpg123_getformat(mh, &li, &m_channel_count, &enc);
            m_sample_rate = (int)li;
            switch (enc)
            {
                case MPG123_ENC_SIGNED_16: m_sample_format = SF_S16; break;
                case MPG123_ENC_UNSIGNED_8: m_sample_format = SF_U8; break;
                default: return false;
            }
            m_first_frame = false;
        }

        m_buffer.write(m_decode_buffer, rv);

        return true;
    }
Пример #12
0
HRESULT MFMovieSource::Open( const wchar_t* pszFilePath )
{
  HRESULT hr;
  hr=MFCreateSourceReaderFromURL( pszFilePath, CreateSourceReaderAttribute(), &_reader );
  PKY_IF_ERR_RETURN( hr, "Create SourceReader Failed" );

  hr=GetDuration( _reader, m_Duration );
  PKY_IF_ERR_RETURN( hr, "GetDuration Failed" );

  hr=GetSourceFlags( _reader, &m_SeekingFlag );

  hr=EnumerateTypsForStream( _reader,(DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM, [this]( IMFMediaType*pType )->bool {
    UINT32 wd;
    UINT32 ht;
    if( SUCCEEDED( GetFrameSize( pType, &wd, &ht ) ) )
    {
      this->_wd=wd;
      this->_ht=ht;
    }
    if( SUCCEEDED( GetKeyFrameDelta( pType, &this->_keyFrameDelta ) ) )
    {

    }
    uint32_t numer, denum;
    if( SUCCEEDED(GetFrameRate(pType, numer, denum)) )
    {
      this->_numer = numer;
      this->_denum = denum;
    }
    return true;
  } );

  _frameCount = (UINT64)(m_Duration * _numer/_denum/10000000.0 + 0.001);

  hr=ConfigureDecoder( _reader, (DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM );
  hr=ConfigureDecoder( _reader, (DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM );

  //Jump(0);

  return E_NOTIMPL;
}
Пример #13
0
int CMpegFrame::GetMainDataSize() const
{
  int nSlots = GetFrameSize();

  //Header Bytes
  nSlots -= 4;
        
  //CRC Bytes
  if( m_nProtectionBit==0 ){
    nSlots -= 2; 
  }

  //SideInfo Bytes
  if( GetChannels()==1 ){
    nSlots -= 17;
  }
  else{
    nSlots -=32;
  }

  return nSlots;
}
Пример #14
0
int TAP_Main (void)
{
  AddTime(0, 0);
  BMP_WriteHeader(NULL, 0, 0);
  BootReason();
  BuildWindowBorder();
  BuildWindowInfo();
  BuildWindowLine();
  BuildWindowLineSelected();
  BuildWindowScrollBar();
  BuildWindowTitle();
  busyWait();
  CalcAbsSectorFromFAT(NULL, 0);
  CalcPrepare();
  CalcTopIndex(0, 0);
  Callback(0, NULL, 0, 0, 0, 0);
  CallbackHelper(NULL, NULL, 0, 0, 0, 0);
  CallBIOS(0, 0, 0, 0, 0);
  CallFirmware(0, 0, 0, 0, 0);
  CallTraceEnable(FALSE);
  CallTraceEnter(NULL);
  CallTraceExit(NULL);
  CallTraceInit();
  CaptureScreen(0, 0, 0, NULL, 0, 0);
  ChangeDirRoot();
  CheckSelectable(0, 0);
  combineVfdData(NULL, NULL);
  compact(NULL, 0);
  CompressBlock(NULL, 0, NULL);
  CompressedTFDSize(NULL, 0, NULL);
  CompressTFD(NULL, 0, NULL, 0, 0, NULL);
  CRC16(0, NULL, 0);
  CRC32 (0, NULL, 0);
  Delay(0);
  DialogEvent(NULL, NULL, NULL);
  DialogMsgBoxButtonAdd(NULL, FALSE);
  DialogMsgBoxExit();
  DialogMsgBoxInit(NULL, NULL, NULL, NULL);
  DialogMsgBoxShow();
  DialogMsgBoxShowInfo(0);
  DialogMsgBoxShowOK();
  DialogMsgBoxShowOKCancel(0);
  DialogMsgBoxShowYesNo(0);
  DialogMsgBoxShowYesNoCancel(0);
  DialogMsgBoxTitleSet(NULL, NULL);
  DialogProfileChange(NULL);
  DialogProfileCheck(NULL, NULL, FALSE);
  DialogProfileLoad(NULL);
  DialogProfileLoadDefault();
  DialogProfileLoadMy(NULL, FALSE);
  DialogProfileSave(NULL);
  DialogProfileSaveDefault();
  DialogProfileScrollBehaviourChange(FALSE, FALSE);
  DialogProgressBarExit();
  DialogProgressBarInit(NULL, NULL, 0, 0, NULL, 0, 0);
  DialogProgressBarSet(0, 0);
  DialogProgressBarShow();
  DialogProgressBarTitleSet(NULL);
  DialogWindowChange(NULL, FALSE);
  DialogWindowCursorChange(FALSE);
  DialogWindowCursorSet(0);
  DialogWindowExit();
  DialogWindowHide();
  DialogWindowInfoAddIcon(0, 0, NULL);
  DialogWindowInfoAddS(0, 0, 0, NULL, 0, 0, 0, 0, 0);
  DialogWindowInfoDeleteAll();
  DialogWindowInit(NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, 0, 0, 0);
  DialogWindowItemAdd(NULL, 0, NULL, 0, FALSE, FALSE, 0, NULL);
  DialogWindowItemAddSeparator();
  DialogWindowItemChangeFlags(0, FALSE, FALSE);
  DialogWindowItemChangeIcon(0, 0, NULL);
  DialogWindowItemChangeParameter(0, NULL, 0);
  DialogWindowItemChangeValue(0, NULL, 0);
  DialogWindowItemDelete(0);
  DialogWindowItemDeleteAll();
  DialogWindowRefresh();
  DialogWindowReInit(0, 0, 0, 0, 0, 0);
  DialogWindowScrollDown();
  DialogWindowScrollDownPage();
  DialogWindowScrollUp();
  DialogWindowScrollUpPage();
  DialogWindowShow();
  DialogWindowTabulatorSet(0, 0);
  DialogWindowTitleChange(NULL, NULL, NULL);
  DialogWindowTypeChange(0);
  DrawMsgBoxButtons();
  DrawMsgBoxTitle();
  DrawOSDLine(0, 0, 0, 0, 0, 0);
  DrawProgressBarBar(0, 0);
  DrawProgressBarTitle();
  DrawWindowBorder();
  DrawWindowInfo();
  DrawWindowLine(0);
  DrawWindowLines();
  DrawWindowScrollBar();
  DrawWindowTitle();
  EndMessageWin();
  exitHook();
  ExtractLine(NULL, NULL);
  FileSelector(NULL, NULL, NULL, 0);
  FileSelectorKey(0, 0);
  FindDBTrack();
  FindInstructionSequence(NULL, NULL, 0, 0, 0, 0);
  findSendToVfdDisplay(0, 0);
  FlashAddFavourite(NULL, 0, FALSE);
  FlashDeleteFavourites();
  FlashFindEndOfServiceNameTableAddress();
  FlashFindEndOfServiceTableAddress(0);
  FlashFindServiceAddress(0, 0, 0, 0);
  FlashFindTransponderIndex(0, 0, 0);
  FlashGetBlockStartAddress(0);
  FlashGetChannelNumber(0, 0, 0, 0);
  FlashGetSatelliteByIndex(0);
  FlashGetServiceByIndex(0, FALSE);
  FlashGetServiceByName (NULL, FALSE);
  FlashGetTransponderCByIndex(0);
  FlashGetTransponderSByIndex(0, 0);
  FlashGetTransponderTByIndex(0);
  FlashGetTrueLocalTime(0, 0);
  FlashGetType();
  FlashInitialize(0);
  FlashProgram();
  FlashReindexFavourites(0, 0, 0);
  FlashReindexTimers(0, 0, 0);
  FlashRemoveCASServices(FALSE);
  FlashRemoveServiceByIndex(0, FALSE);
  FlashRemoveServiceByIndexString(NULL, FALSE);
  FlashRemoveServiceByLCN(NULL, FALSE);
  FlashRemoveServiceByName(NULL, FALSE);
  FlashRemoveServiceByPartOfName(NULL, FALSE);
  FlashRemoveServiceByUHF(NULL, FALSE, FALSE);
  FlashServiceAddressToServiceIndex(NULL);
  FlashWrite(NULL, NULL, 0, NULL);
  FlushCache(NULL, 0);
  FreeOSDRegion(0);
  fwHook(0);
  GetAudioTrackPID(0, NULL);
  GetClusterPointer(0);
  GetCurrentEvent(NULL);
  GetEEPROMAddress();
  GetEEPROMPin();
  GetFrameBufferPixel(0, 0);
  GetFrameSize(0, 0);
  GetFWInfo(0, 0, 0, 0, 0, 0, 0, 0);
  GetHeapParameter(NULL, 0);
  GetLine(NULL, 0);
  GetOSDMapAddress();
  GetOSDRegionHeight(0);
  GetOSDRegionWidth(0);
  GetPinStatus();
  GetPIPPosition(NULL, NULL, NULL, NULL);
  getRECSlotAddress();
  GetSysOsdControl(0);
  GetToppyString(0);
  HasEnoughItemMemory();
  HDD_AAM_Disable();
  HDD_AAM_Enable(0);
  HDD_APM_Disable();
  HDD_APM_Enable(0);
  HDD_BigFile_Read(NULL, 0, 0, NULL);
  HDD_BigFile_Size(NULL);
  HDD_BigFile_Write(NULL, 0, 0, NULL);
  HDD_ChangeDir(NULL);
  HDD_DecodeRECHeader(NULL, NULL);
  HDD_EncodeRECHeader(NULL, NULL, 0);
  HDD_FappendOpen(NULL);
  HDD_FappendWrite(NULL, NULL);
  HDD_FindPCR(NULL, 0);
  HDD_FindPMT(NULL, 0, NULL);
  HDD_FreeSize();
  HDD_GetClusterSize();
  HDD_GetFileDir(NULL, 0, NULL);
  HDD_GetFirmwareDirCluster();
  HDD_GetHddID(NULL, NULL, NULL);
  HDD_IdentifyDevice(NULL);
  HDD_isAnyRecording();
  HDD_isCryptedStream(NULL, 0);
  HDD_isRecording(0);
  HDD_LiveFS_GetChainLength(0);
  HDD_LiveFS_GetFAT1Address();
  HDD_LiveFS_GetFAT2Address();
  HDD_LiveFS_GetFirstCluster(0);
  HDD_LiveFS_GetLastCluster(0);
  HDD_LiveFS_GetNextCluster(0);
  HDD_LiveFS_GetPreviousCluster(0);
  HDD_LiveFS_GetRootDirAddress();
  HDD_LiveFS_GetSuperBlockAddress();
  HDD_MakeNewRecName(NULL, 0);
  HDD_Move(NULL, NULL, NULL);
  HDD_ReadClusterDMA(0, NULL);
  HDD_ReadSector(0, 0);
  HDD_ReadSectorDMA(0, 0, NULL);
  HDD_RECSlotGetAddress(0);
  HDD_RECSlotIsPaused(0);
  HDD_RECSlotPause(0, FALSE);
  HDD_RECSlotSetDuration(0, 0);
  HDD_SetCryptFlag(NULL, 0);
  HDD_SetFileDateTime(NULL, 0, 0, 0);
  HDD_SetSkipFlag (NULL, FALSE);
  HDD_SetStandbyTimer(0);
  HDD_Smart_DisableAttributeAutoSave();
  HDD_Smart_DisableOperations();
  HDD_Smart_EnableAttributeAutoSave();
  HDD_Smart_EnableOperations();
  HDD_Smart_ExecuteOfflineImmediate(0);
  HDD_Smart_ReadData(0);
  HDD_Smart_ReadThresholdData(0);
  HDD_Smart_ReturnStatus();
  HDD_Stop();
  HDD_TAP_Callback(0, NULL, 0, 0, 0, 0);
  HDD_TAP_Disable(0, 0);
  HDD_TAP_DisableAll(0);
  HDD_TAP_DisabledEventHandler(0, 0, 0);
  HDD_TAP_GetCurrentDir(NULL);
  HDD_TAP_GetCurrentDirCluster();
  HDD_TAP_GetIDByFileName(NULL);
  HDD_TAP_GetIDByIndex(0);
  HDD_TAP_GetIndexByID(0);
  HDD_TAP_GetInfo(0, NULL);
  HDD_TAP_GetStartParameter();
  HDD_TAP_isAnyRunning();
  HDD_TAP_isBatchMode();
  HDD_TAP_isDisabled(0);
  HDD_TAP_isDisabledAll();
  HDD_TAP_isRunning(0);
  HDD_TAP_SendEvent(0, FALSE, 0, 0, 0);
  HDD_TAP_SetCurrentDirCluster(0);
  HDD_TAP_Start(NULL, FALSE, NULL, NULL);
  HDD_TAP_StartedByTAP();
  HDD_TAP_Terminate(0);
  HDD_TouchFile(NULL);
  HDD_TranslateDirCluster(0, NULL);
  HDD_TruncateFile(NULL, 0);
  HDD_Write(NULL, 0, NULL);
  HDD_WriteClusterDMA(0, NULL);
  HDD_WriteSectorDMA(0, 0, NULL);
  HookEnable(0, 0);
  HookExit();
  HookIsEnabled(0);
  HookMIPS_Clear(0, 0, 0);
  HookMIPS_Set(0, 0, 0);
  HookSet(0, 0);
  IMEM_Alloc(0);
  IMEM_Init(0);
  IMEM_isInitialized();
  IMEM_Compact();
  IMEM_Free(NULL);
  IMEM_GetInfo(NULL, NULL);
  IMEM_Kill();
  InfoTestGrid();
  INICloseFile();
  INIFindStartEnd(NULL, NULL, NULL, 0);
  INIGetARGB(NULL, NULL, NULL, NULL, NULL, 0);
  INIGetHexByte(NULL, 0, 0, 0);
  INIGetHexDWord(NULL, 0, 0, 0);
  INIGetHexWord(NULL, 0, 0, 0);
  INIGetInt(NULL, 0, 0, 0);
  INIGetString(NULL, NULL, NULL, 0);
  INIKillKey(NULL);
  INIOpenFile(NULL);
  INISaveFile(NULL);
  INISetARGB(NULL, 0, 0, 0, 0);
  INISetComment(NULL);
  INISetHexByte(NULL, 0);
  INISetHexDWord(NULL, 0);
  INISetHexWord(NULL, 0);
  INISetInt(NULL, 0);
  INISetString(NULL, NULL);
  initCodeWrapper(0);
  InitTAPAPIFix();
  InitTAPex();
  InteractiveGetStatus();
  InteractiveSetStatus(FALSE);
  intLock();
  intUnlock(0);
  isAnyOSDVisible(0, 0, 0, 0);
  isLegalChar(0, 0);
  isMasterpiece();
  isMPMenu();
  iso639_1(0);
  isOSDRegionAlive(0);
  isValidChannel(NULL);
  LangGetString(0);
  LangLoadStrings(NULL, 0, 0);
  LangUnloadStrings();
  Log(NULL, NULL, FALSE, 0, NULL);
  LowerCase(NULL);
  MakeValidFileName(NULL, 0);
  MHEG_Status();
  MPDisplayClearDisplay();
  MPDisplayClearSegments(0, 0);
  MPDisplayDisplayLongString(NULL);
  MPDisplayDisplayShortString(NULL);
  MPDisplayGetDisplayByte(0);
  MPDisplayGetDisplayMask(0);
  MPDisplayInstallMPDisplayFwHook();
  MPDisplaySetAmFlag(0);
  MPDisplaySetColonFlag(0);
  MPDisplaySetDisplayByte(0, 0);
  MPDisplaySetDisplayMask(0, 0);
  MPDisplaySetDisplayMemory(NULL);
  MPDisplaySetDisplayMode(0);
  MPDisplaySetPmFlag(0);
  MPDisplaySetSegments(0, 0);
  MPDisplayToggleSegments(0, 0);
  MPDisplayUninstallMPDisplayFwHook();
  MPDisplayUpdateDisplay();
  Now(NULL);
  OSDCopy(0, 0, 0, 0, 0, 0, 0);
  OSDLinesForeDirty(FALSE);
  ParseLine(NULL, NULL, 0);
  ProfileDirty();
  ProfileInit();
  ProfileLoad(NULL, FALSE);
  ProfileMayReload();
  ReadEEPROM(0, 0, NULL);
  ReadIICRegister(0, 0, 0, 0, NULL);
  Reboot(0);
  ReceiveSector(0);
  RTrim(NULL);
  SaveBitmap(NULL, 0, 0, NULL);
  SendEvent(0, 0, 0, 0);
  SendEventHelper(NULL, 0, 0, 0);
  SendHDDCommand(0, 0, 0, 0, 0, 0, 0);
  SendToFP(NULL);
  SeparatePathComponents(NULL, NULL, NULL, NULL);
  SetCrashBehaviour(0);
  setSymbol14(0, 0);
  setSymbol17(0, 0);
  ShowMessageWin(NULL, NULL, NULL, 0);
  ShowMessageWindow(NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  Shutdown(0);
  SoundSinus(0, 0, 0);
  StrEndsWith(NULL, NULL);
  stricstr(NULL, NULL);
  SubtitleGetStatus();
  SubtitleSetStatus(FALSE);
  SuppressedAutoStart();
  SwapDWords(0);
  SwapWords(0);
  TAP_Osd_PutFreeColorGd(0, 0, 0, NULL, FALSE, 0);
  TAPCOM_CloseChannel(NULL);
  TAPCOM_Finish(NULL, 0);
  TAPCOM_GetChannel(0, NULL, NULL, NULL, NULL);
  TAPCOM_GetReturnValue(NULL);
  TAPCOM_GetStatus(NULL);
  TAPCOM_LastAlive(NULL);
  TAPCOM_OpenChannel(0, 0, 0, NULL);
  TAPCOM_Reject(NULL);
  TAPCOM_StillAlive(NULL);
  TFDSize(NULL);
  TimeDiff(0, 0);
  TimeFormat(0, 0, 0);
  TunerGet(0);
  TunerSet(0);
  UncompressBlock(NULL, 0, NULL, 0);
  UncompressedFirmwareSize(NULL);
  UncompressedLoaderSize(NULL);
  UncompressedTFDSize(NULL);
  UncompressFirmware(NULL, NULL, NULL);
  UncompressLoader(NULL, NULL, NULL);
  UncompressTFD(NULL, NULL, NULL);
  UpperCase(NULL);
  ValidFileName(NULL, 0);
  WindowDirty();
  WriteIICRegister(0, 0, 0, 0, NULL);
  YUV2RGB(0, 0, 0, NULL, NULL, NULL);
  YUV2RGB2(0, 0, 0, NULL, NULL, NULL);

  return 0;
}
Пример #15
0
bool AudioEncoder::EncodeFrame(AVFrame* frame) {

	if(frame != NULL) {
#if SSR_USE_AVFRAME_NB_SAMPLES
		assert((unsigned int) frame->nb_samples == GetFrameSize());
#endif
#if SSR_USE_AVFRAME_CHANNELS
		assert(frame->channels == GetStream()->codec->channels);
#endif
#if SSR_USE_AVFRAME_SAMPLE_RATE
		assert(frame->sample_rate == GetStream()->codec->sample_rate);
#endif
#if SSR_USE_AVFRAME_FORMAT
		assert(frame->format == GetStream()->codec->sample_fmt);
#endif
	}

#if SSR_USE_AVCODEC_ENCODE_AUDIO2

	// allocate a packet
	std::unique_ptr<AVPacketWrapper> packet(new AVPacketWrapper());

	// encode the frame
	int got_packet;
	if(avcodec_encode_audio2(GetStream()->codec, packet->GetPacket(), frame, &got_packet) < 0) {
		Logger::LogError("[AudioEncoder::EncodeFrame] " + Logger::tr("Error: Encoding of audio frame failed!"));
		throw LibavException();
	}

	// do we have a packet?
	if(got_packet) {

		// send the packet to the muxer
		GetMuxer()->AddPacket(GetStream()->index, std::move(packet));
		return true;

	} else {
		return false;
	}

#else

	// encode the frame
	short *data = (frame == NULL)? NULL : (short*) frame->data[0];
	int bytes_encoded = avcodec_encode_audio(GetStream()->codec, m_temp_buffer.data(), m_temp_buffer.size(), data);
	if(bytes_encoded < 0) {
		Logger::LogError("[AudioEncoder::EncodeFrame] " + Logger::tr("Error: Encoding of audio frame failed!"));
		throw LibavException();
	}

	// do we have a packet?
	if(bytes_encoded > 0) {

		// allocate a packet
		std::unique_ptr<AVPacketWrapper> packet(new AVPacketWrapper(bytes_encoded));

		// copy the data
		memcpy(packet->GetPacket()->data, m_temp_buffer.data(), bytes_encoded);

		// set the timestamp
		// note: pts will be rescaled and stream_index will be set by Muxer
		if(GetStream()->codec->coded_frame != NULL && GetStream()->codec->coded_frame->pts != (int64_t) AV_NOPTS_VALUE)
			packet->GetPacket()->pts = GetStream()->codec->coded_frame->pts;

		// send the packet to the muxer
		GetMuxer()->AddPacket(GetStream()->index, std::move(packet));
		return true;

	} else {
		return false;
	}

#endif

}
Пример #16
0
bool AudioEncoder::EncodeFrame(AVFrameWrapper* frame) {

	if(frame != NULL) {
#if SSR_USE_AVFRAME_NB_SAMPLES
		assert((unsigned int) frame->GetFrame()->nb_samples == GetFrameSize());
#endif
#if SSR_USE_AVFRAME_CHANNELS
		assert(frame->GetFrame()->channels == GetCodecContext()->channels);
#endif
#if SSR_USE_AVFRAME_SAMPLE_RATE
		assert(frame->GetFrame()->sample_rate == GetCodecContext()->sample_rate);
#endif
#if SSR_USE_AVFRAME_FORMAT
		assert(frame->GetFrame()->format == GetCodecContext()->sample_fmt);
#endif
	}

#if SSR_USE_AVCODEC_SEND_RECEIVE

	// send a frame
	AVFrame *avframe = (frame == NULL)? NULL : frame->Release();
	try {
		if(avcodec_send_frame(GetCodecContext(), avframe) < 0) {
			Logger::LogError("[AudioEncoder::EncodeFrame] " + Logger::tr("Error: Sending of audio frame failed!"));
			throw LibavException();
		}
	} catch(...) {
		av_frame_free(&avframe);
		throw;
	}
	av_frame_free(&avframe);

	// try to receive a packet
	for( ; ; ) {
		std::unique_ptr<AVPacketWrapper> packet(new AVPacketWrapper());
		int res = avcodec_receive_packet(GetCodecContext(), packet->GetPacket());
		if(res == 0) { // we have a packet, send the packet to the muxer
			GetMuxer()->AddPacket(GetStream()->index, std::move(packet));
			IncrementPacketCounter();
		} else if(res == AVERROR(EAGAIN)) { // we have no packet
			return true;
		} else if(res == AVERROR_EOF) { // this is the end of the stream
			return false;
		} else {
			Logger::LogError("[AudioEncoder::EncodeFrame] " + Logger::tr("Error: Receiving of audio packet failed!"));
			throw LibavException();
		}
	}

#elif SSR_USE_AVCODEC_ENCODE_AUDIO2

	// allocate a packet
	std::unique_ptr<AVPacketWrapper> packet(new AVPacketWrapper());

	// encode the frame
	int got_packet;
	if(avcodec_encode_audio2(GetCodecContext(), packet->GetPacket(), (frame == NULL)? NULL : frame->GetFrame(), &got_packet) < 0) {
		Logger::LogError("[AudioEncoder::EncodeFrame] " + Logger::tr("Error: Encoding of audio frame failed!"));
		throw LibavException();
	}

	// do we have a packet?
	if(got_packet) {

		// send the packet to the muxer
		GetMuxer()->AddPacket(GetStream()->index, std::move(packet));
		IncrementPacketCounter();
		return true;

	} else {
		return false;
	}

#else

	// encode the frame
	short *data = (frame == NULL)? NULL : (short*) frame->GetFrame()->data[0];
	int bytes_encoded = avcodec_encode_audio(GetCodecContext(), m_temp_buffer.data(), m_temp_buffer.size(), data);
	if(bytes_encoded < 0) {
		Logger::LogError("[AudioEncoder::EncodeFrame] " + Logger::tr("Error: Encoding of audio frame failed!"));
		throw LibavException();
	}

	// do we have a packet?
	if(bytes_encoded > 0) {

		// allocate a packet
		std::unique_ptr<AVPacketWrapper> packet(new AVPacketWrapper(bytes_encoded));

		// copy the data
		memcpy(packet->GetPacket()->data, m_temp_buffer.data(), bytes_encoded);

		// set the timestamp
		// note: pts will be rescaled and stream_index will be set by Muxer
		if(GetCodecContext()->coded_frame != NULL && GetCodecContext()->coded_frame->pts != (int64_t) AV_NOPTS_VALUE)
			packet->GetPacket()->pts = GetCodecContext()->coded_frame->pts;

		// send the packet to the muxer
		GetMuxer()->AddPacket(GetStream()->index, std::move(packet));
		IncrementPacketCounter();
		return true;

	} else {
		return false;
	}

#endif

}
Пример #17
0
int cMotion::GetNumDof() const
{
	return GetFrameSize() - 1;
}
Пример #18
0
cMotion::tFrame cMotion::GetFrame(int i) const
{
	int frame_size = GetFrameSize();
	return mFrames.row(i).segment(1, frame_size - 1);
}
Пример #19
0
int SetScaleParam(enum PixelFormat srcfmt,
			int srcwidth,int srcheight,enum PixelFormat dstfmt,int dstwidth,int dstheight)
{
	if(ScaleUseNum != 1)
	{
		printf("Another is using scale pp!\n");		
		return FALSE;
	}

	if((CHECKBOUNDS(srcwidth) < 0) || (CHECKBOUNDS(srcheight) < 0))
		return FALSE;

	if((CHECKBOUNDS(dstwidth) < 0) || (CHECKBOUNDS(dstheight) < 0))
		return FALSE;

	cspace_t sfmt = GetFMT(srcfmt);
	cspace_t dfmt = GetFMT(dstfmt);

	if((sfmt == FMTNONE) || (dfmt == FMTNONE))
		return FALSE;

	//remain dstfmt
	sparam.dstfmt = dstfmt;
	//set src params
	sparam.m_bparam.SrcFullWidth = srcwidth;
	sparam.m_bparam.SrcFullHeight = srcheight;
	sparam.m_bparam.SrcStartX = 0;
	sparam.m_bparam.SrcStartY = 0;
	sparam.m_bparam.SrcWidth = srcwidth;
	sparam.m_bparam.SrcHeight = srcheight;
	sparam.m_bparam.SrcCSpace = sfmt;
	//set dst params
	sparam.m_bparam.DstFullWidth = dstwidth;
	sparam.m_bparam.DstFullHeight = dstheight;
	sparam.m_bparam.DstStartX = 0;
	sparam.m_bparam.DstStartY = 0;
	sparam.m_bparam.DstWidth = dstwidth;
	sparam.m_bparam.DstHeight = dstheight;
	sparam.m_bparam.DstCSpace = dfmt;

	//set post on path --> DMA
	sparam.m_bparam.OutPath = POST_DMA;
	sparam.m_bparam.Mode = PROGRESSIVE_MODE;

	ioctl(sparam.m_bfileID, PP_SET_PARAMS,&sparam.m_bparam);

		//prealloc inbuf
	int buf_size = ioctl(sparam.m_bfileID, PP_GET_RESERVED_MEM_SIZE);

	sparam.m_binsize = GetFrameSize(srcfmt,srcwidth,srcheight);
	sparam.m_boutsize = GetFrameSize(dstfmt,dstwidth,dstheight);
	sparam.m_bsize = sparam.m_binsize + sparam.m_boutsize;

	if(sparam.m_bsize > buf_size)
		return FALSE;

      sparam.lgcinaddr = (uint8_t *) mmap(0, sparam.m_bsize, PROT_READ | PROT_WRITE,MAP_SHARED, sparam.m_bfileID, 0);
	
	if(!sparam.lgcinaddr)
		return FALSE;

	//prealloc outbuf
	sparam.lgcoutaddr = sparam.lgcinaddr + sparam.m_binsize;

	if(!sparam.lgcoutaddr)
		return FALSE;

      sparam.m_bparam.SrcFrmSt = ioctl(sparam.m_bfileID, PP_GET_RESERVED_MEM_ADDR_PHY);
	ioctl(sparam.m_bfileID, PP_SET_SRC_BUF_ADDR_PHY,&sparam.m_bparam);

      sparam.m_bparam.DstFrmSt = sparam.m_bparam.SrcFrmSt + sparam.m_binsize;
	ioctl(sparam.m_bfileID, PP_SET_DST_BUF_ADDR_PHY,&sparam.m_bparam);

	
	sparam.m_bset = TRUE;
	return sparam.m_bset;
}
Пример #20
0
void cMotion::SetFrame(int i, const tFrame& frame)
{
	int frame_size = GetFrameSize();
	assert(frame.size() == frame_size - 1);
	mFrames.row(i).segment(1, frame_size - 1) = frame;
}
Пример #21
0
bool DVFrame::IsComplete( void )
{
	return GetDataLen() == GetFrameSize();
}