Esempio n. 1
0
static const ASN1_OBJECT* COSSLCERT_LnToObj( const char * s )
{	long sz = oexSizeOfArray( nid_objs );
	for( long i = 0; i < sz; i++ )
		if ( !oex::zstr::Compare( s, nid_objs[ i ].ln ) )
			return &nid_objs[ i ];
	return oexNULL;
}
Esempio n. 2
0
int CFfConvert::ConvertFB( AVFrame* src, sqbind::CSqBinary *dst )
{_STT();

	if ( !m_psc )
		return 0;
	
_STT_SET_CHECKPOINT( 10 );

	// Ensure source buffer is large enough
	if ( !src )
		return 0;

	// Allocate memory for destination image
	if ( dst->Size() < ( m_dst_size + FF_INPUT_BUFFER_PADDING_SIZE * 2 )
		 && !dst->Allocate( m_dst_size + FF_INPUT_BUFFER_PADDING_SIZE * 2 ) )
		return 0;
				
_STT_SET_CHECKPOINT( 11 );

	// Fill in picture data
	AVPicture apSrc, apDst;
	
	// Copy source information
	oexZero( apSrc );
	for ( int i = 0; i < (int)oexSizeOfArray( apSrc.linesize ); i++ )
		apSrc.data[ i ] = src->data[ i ],
		apSrc.linesize[ i ] = src->linesize[ i ];
	
	if ( !CFfFmt::FillAVPicture( &apDst, m_dst_fmt, m_dst_width, m_dst_height, dst->_Ptr() ) )
		return 0;

_STT_SET_CHECKPOINT( 12 );

	if ( m_flip )
		Flip( m_src_fmt, m_src_height, &apSrc );

_STT_SET_CHECKPOINT( 13 );

	int nRet = sws_scale(	m_psc, apSrc.data, apSrc.linesize, 0, m_src_height,
							apDst.data, apDst.linesize );

_STT_SET_CHECKPOINT( 14 );

	if ( 0 >= nRet )
		return 0;

	dst->setUsed( m_dst_size );

	return 1;
}
Esempio n. 3
0
int CFfConvert::ConvertFI( AVFrame* src, sqbind::CSqImage *dst )
{_STT();

	if ( !m_psc )
		return 0;
	
_STT_SET_CHECKPOINT( 10 );

	// Ensure source buffer is large enough
	if ( !src )
		return 0;

	// Do we need to allocate destination image?
	if ( dst->getWidth() != m_dst_width || dst->getHeight() != m_dst_height )
		if ( !dst->Create( m_dst_width, m_dst_height ) )
			return 0;
		
_STT_SET_CHECKPOINT( 11 );

	// Fill in picture data
	AVPicture apSrc, apDst;

	// Copy source information
	oexZero( apSrc );
	for ( int i = 0; i < (int)oexSizeOfArray( apSrc.linesize ); i++ )
		apSrc.data[ i ] = src->data[ i ],
		apSrc.linesize[ i ] = src->linesize[ i ];
	
	if ( !CFfFmt::FillAVPicture( &apDst, m_dst_fmt, m_dst_width, m_dst_height, dst->Obj().GetBits() ) )
		return 0;

_STT_SET_CHECKPOINT( 12 );

	if ( m_flip )
		Flip( m_src_fmt, m_src_height, &apSrc );

_STT_SET_CHECKPOINT( 13 );

	int nRet = sws_scale(	m_psc, apSrc.data, apSrc.linesize, 0, m_src_height,
							apDst.data, apDst.linesize );

_STT_SET_CHECKPOINT( 14 );

	if ( 0 >= nRet )
		return 0;

	return 1;
}