[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-datatype-dev
Subject: [datatype-dev] Re: CR: flash filewriter write metadata bitrates in
From: Eric Hyche <ehyche () real ! com>
Date: 2010-01-26 16:38:41
Message-ID: 3067B248-A30F-4209-AF37-DD9EBB6B062F () real ! com
[Download RAW message or body]
Looks good.
On Jan 25, 2010, at 1:58 PM, Tad Yeager wrote:
> Synopsis:
> flash filewriter should write metadata bitrates in Kbps
>
> Overview:
> When reading in the video and audio bitrates from the flash metadata packet
> (HX_FLV_TAG_TYPE_META:
> datatype\flash\flv\fileformat\flv_file_format.cpp@1143, 1133) the bitrate
> is converted from a float value in Kbps to a UINT32 in bps. Other file
> format plugins do this too (eg, datatype\aac\fileformat\aacff.cpp@1059).
> This value is later written back in the filewriter without converting back
> to Kbps. The fix attached converts back to Kbps.
>
> Files Modified:
> datatype\flash\flv\filewriter\flvarch.cpp
>
> Image Size and Heap Use impact (Client -Only):
> None.
>
> Platforms and Profiles Affected:
> Windows, Mac & Linux
>
> Distribution Libraries Affected:
> None.
>
> Distribution library impact and planned action:
> None.
>
> Platforms and Profiles Build Verified:
> Profile: win32-i386-vc7
> Platform: win32
>
> Platforms and Profiles Functionality verified:
> Profile: win32-i386-vc7
> Platform: win32
>
> Branch: 310Atlas, HEAD. If the fix is OK, please let me know where else
> you'd like this change merged! Assuming Brizo and other Alas branches but
> will wait until confirmed.
>
> Copyright assignment: I am a RealNetworks employee.
>
> ? Makefile
> ? Umakefil.upp
> ? datatype_flash_flv_filewriter.sln
> ? datatype_flash_flv_filewriter.vcproj
> ? dbg32
> ? flvwrtr.def
> ? ribosome_logs
> Index: flvarch.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/flash/flv/filewriter/flvarch.cpp,v
> retrieving revision 1.1.2.1
> diff -u -2 -0 -r1.1.2.1 flvarch.cpp
> --- flvarch.cpp 18 Sep 2009 19:21:19 -0000 1.1.2.1
> +++ flvarch.cpp 25 Jan 2010 18:28:48 -0000
> @@ -858,48 +858,48 @@
> Byte* pData = pBuffer->GetBuffer();
>
> // Header
> PackUINT8Inc(&pData, &nPacketSize,
> HX_FLV_META_AMF_TYPE_STRING);
> PackUINT16BEInc(&pData, &nPacketSize, strlen(szOnMetaData));
>
> memcpy(pData, szOnMetaData, strlen(szOnMetaData));
> pData += strlen(szOnMetaData);
> nPacketSize -= strlen(szOnMetaData);
>
> PackUINT8Inc(&pData, &nPacketSize,
> HX_FLV_META_AMF_TYPE_MIXEDARRAY);
> PackUINT32BEInc(&pData, &nPacketSize, nNumFields);
>
> PackNumberField(&pData, &nPacketSize, szDuration,
> (double)m_nDuration/1000.);
> m_nDurationOffset = m_ulFileOffset + pData -
> pBuffer->GetBuffer() - 8;
>
> if(m_bHasVideo)
> {
> PackNumberField(&pData, &nPacketSize, szWidth,
> (double)m_nWidth);
> PackNumberField(&pData, &nPacketSize, szHeight,
> (double)m_nHeight);
> - PackNumberField(&pData, &nPacketSize, szVideoDataRate,
> (double)m_nVideoBitRate);
> + PackNumberField(&pData, &nPacketSize, szVideoDataRate,
> (double)(m_nVideoBitRate / 1000) + 0.5);
> PackNumberField(&pData, &nPacketSize, szFrameRate,
> m_dVideoFrameRate);
> PackNumberField(&pData, &nPacketSize, szVideoCodecID,
> (double)m_nVideoType);
> }
>
> if(m_bHasAudio)
> {
> - PackNumberField(&pData, &nPacketSize, szAudioDataRate,
> (double)m_nAudioBitRate);
> + PackNumberField(&pData, &nPacketSize, szAudioDataRate,
> (double)(m_nAudioBitRate / 1000) + 0.5);
> PackNumberField(&pData, &nPacketSize, szAudioCodecID,
> (double)m_nAudioType);
> }
>
> HX_ASSERT(nPacketSize == 0);
>
> nResult = WriteBuffer(pBuffer);
> HX_RELEASE(pBuffer);
> }
> }
> }
>
> m_nAudioPacketInfo = m_nAudioType << 4;
> switch(m_nSamplesPerSecond)
> {
> case 11025:
> m_nAudioPacketInfo |= 0x1 << 2;
> break;
> case 22050:
> m_nAudioPacketInfo |= 0x2 << 2;
> break;
>
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
_______________________________________________
Datatype-dev mailing list
Datatype-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic