mp4asp_dec/arimpeg4aspdechwdevice/src/arimpeg4aspdechwdevice.cpp
author Pat Downey <patd@symbian.org>
Fri, 23 Jul 2010 16:58:44 +0100
changeset 0 bb31fbe78861
permissions -rw-r--r--
Initial commit of Aricent codec contribution.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2009 Aricent and/or its subsidiary(-ies).
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Aricent - initial contribution.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
* This is a source file, which is required for Mp4DecHwDevice.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
*/
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
//User includes
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include "arimpeg4aspdechwdevice.h"
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include "aristatemachine.h"
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include "ariprint.h"
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
//manufacturer name
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
_LIT( KManufacturer, "Aricent" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
_LIT( KIdentifier, "MPEG4/H263 Video Decoder" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
//supported mime types for mp4
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
_LIT8( KMPEG4SupportedMimeType, "video/mp4v-es" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
// profile level 0
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
_LIT8( KMPEG4SupportedProfileLevel_0, "video/mp4v-es; profile-level-id=8" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
// profile level 0b / 11
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
_LIT8( KMPEG4SupportedProfileLevel_0b, "video/mp4v-es; profile-level-id=9" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
// profile level 1
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
_LIT8( KMPEG4SupportedProfileLevel_1, "video/mp4v-es; profile-level-id=1" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
// profile level 2
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
_LIT8( KMPEG4SupportedProfileLevel_2, "video/mp4v-es; profile-level-id=2" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
// profile level 3
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
_LIT8( KMPEG4SupportedProfileLevel_3, "video/mp4v-es; profile-level-id=3" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
// profile level 4
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
_LIT8( KMPEG4SupportedProfileLevel_4, "video/mp4v-es; profile-level-id=4" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
// profile level 5
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
_LIT8( KMPEG4SupportedProfileLevel_5, "video/mp4v-es; profile-level-id=5" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
//supported mime types for h263
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
_LIT8( KH263SupportedMimeType, "video/h263-2000" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
_LIT8( KH26398SupportedMimeType, "video/h263-1998" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
// h263 profile level 10
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
_LIT8( KH263SupportedProfileLevel_10, "video/h263-2000;profile=0;level=10" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
// h263 profile level 20
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
_LIT8( KH263SupportedProfileLevel_20, "video/h263-2000;profile=0;level=20" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
// h263 profile level 30
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
_LIT8( KH263SupportedProfileLevel_30, "video/h263-2000;profile=0;level=30" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
// h263 profile level 45
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
_LIT8( KH263SupportedProfileLevel_45, "video/h263-2000;profile=0;level=45" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
//1st phase constructor of CAriMpeg4aspdecHwDevice
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
CMMFVideoDecodeHwDevice* CAriMpeg4aspdecHwDevice::NewL()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
	CAriMpeg4aspdecHwDevice* self = new ( ELeave ) CAriMpeg4aspdecHwDevice;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
	CleanupStack::PushL( self );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
	self->ConstructL();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
	CleanupStack::Pop( self );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
	return self;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
//Destructor
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
CAriMpeg4aspdecHwDevice::~CAriMpeg4aspdecHwDevice()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
	delete iInputFormat;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
	delete iEngine;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
	delete iCodec;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
	delete iState;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
    delete iVideoPictureHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
	// This is required becoz user may say exit before start at that point
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
	// OutputFreeBuffer is not created
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
	if ( iOutputFreeBuffer )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
		for ( TInt i = 0 ; i < KMaxOutputBuffers; i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
            if ( ( iOutputFreeBuffer + i )->iHeader )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
                {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
			    delete ( iOutputFreeBuffer + i )->iHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
                }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
			if ( ( iOutputFreeBuffer + i )->iData.iRawData )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
				delete
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
				( TUint8* )( iOutputFreeBuffer + i )->iData.iRawData->Ptr();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
            if ( ( iOutputFreeBuffer + i )->iData.iRawData )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
                {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
			    delete ( iOutputFreeBuffer + i )->iData.iRawData;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
                }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
		delete [] iOutputFreeBuffer;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
	if ( iInputFreeBuffers )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
		TInt i;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
		for ( i = 0 ; i < TInt( iBufferOptions.iMinNumInputBuffers ); i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
			delete [] ( TUint8* )iInputFreeBuffers[i].iData.Ptr();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
			delete iInputFreeBuffers[i].iUser;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
		delete [] iInputFreeBuffers;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
	if ( iCustomBufferOptions )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
		delete iCustomBufferOptions;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
    iOutputFreeBufferQueue.Close();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
	iInputFreeBufferQueue.Close();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
	iMaxPictureRates.Reset();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
	iMaxPictureRates.Close();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
	iSupportedFormats.Reset();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
	iSupportedFormats.Close();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
    iOutputDevice = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
    iMMFDevVideoPlayProxy = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
    iCustomBufferHandle = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
//Retrieves a custom interface to the device.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
TAny* CAriMpeg4aspdecHwDevice::CustomInterface( TUid /*aInterface*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
	return NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
//Retrieves decoder information about this hardware device. The device
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
//creates a CVideoDecoderInfo structure, fills it with correct data,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
//pushes it to the cleanup stack and returns it. The client will delete the
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
//object when it is no longer needed.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
CVideoDecoderInfo* CAriMpeg4aspdecHwDevice::VideoDecoderInfoLC()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
    PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
    for ( TUint i = 0; i < KDecoderInfoCount; i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
		// construct the video types for iVidTypes
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
		CCompressedVideoFormat* format = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
		TPtrC8 mimeType = KDecoderInfoMimeArray[i];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
		format = CCompressedVideoFormat::NewL( mimeType );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
		CleanupStack::PushL(format);
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
		TInt status = iSupportedFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
		if ( status != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
			PRINT_MSG( LEVEL_LOW, ( " Format support is not done, retval of "
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
					"append = %d \n", status ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
		CleanupStack::Pop( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
		// max picture rates
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
		TPictureRateAndSize pictureRateAndSize;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
		pictureRateAndSize.iPictureSize = TSize( KMaxFrameWidth,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
				                                KMaxFrameHeight );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
		pictureRateAndSize.iPictureRate = KPicRate;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
		status = iMaxPictureRates.Append(pictureRateAndSize);
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
		if ( status != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
			PRINT_MSG( LEVEL_LOW, ( " error in appendng picturerates = %d \n",
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
					status ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
    TUint maxBitRate = KMaxBitRate;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
    CVideoDecoderInfo* videoDecoderInfo = CVideoDecoderInfo::NewL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
        	KUidMp4H263DecoderHwDevice,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
        	KManufacturer,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
        	KIdentifier,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
         	TVersion( 1, 0, 0 ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
        	iSupportedFormats.Array(),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
        	EFalse,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
        	EFalse,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
			TSize( KMaxFrameWidth, KMaxFrameHeight ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
			maxBitRate,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
			iMaxPictureRates.Array(),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
			ETrue,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
			ETrue );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
    CleanupStack::PushL( videoDecoderInfo );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
    PRINT_MSG( LEVEL_LOW, ( "Closing maxPictureRates&supportedFormats\n" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
    return videoDecoderInfo;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
//Reads header information from a coded data unit.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
TVideoPictureHeader* CAriMpeg4aspdecHwDevice::GetHeaderInformationL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
								TVideoDataUnitType /*aDataUnitType*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
								TVideoDataUnitEncapsulation aEncapsulation,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
								TVideoInputBuffer* aDataUnit )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
    if ( !aDataUnit )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
	    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
	    PRINT_ERR( "Input argument is not proper, aDataUnit is null \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
		User::Leave( KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
    if ( aEncapsulation != EDuElementaryStream )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
    	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
    	PRINT_ERR( "aEncapsulation is not supported type \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
        User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
    iVideoPictureHeader = new ( ELeave ) TVideoPictureHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
	TRAPD( err, CAriMpeg4aspdecWrapper::GetHeaderInfoL(  *aDataUnit,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
												  *iVideoPictureHeader ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    if ( err == KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
		PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
        return ( iVideoPictureHeader );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
    delete iVideoPictureHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
    iVideoPictureHeader = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
    switch ( err )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
        case KErrCorrupt:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
        case KErrNoMemory:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
        case KErrArgument:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
        case KErrNotSupported:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
            PRINT_ERR( "GetHeaderInfoL is returned with error \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
            User::Leave( err );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
            break;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
        case KErrUnderflow:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
            PRINT_ERR( "GetHeaderInfoL returnd with error KErrUnderflow\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
            break;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
        default:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
            PRINT_ERR( "GetHeaderInfoL is returned with error \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
            User::Leave( KErrGeneral );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
        };
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
	return NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
//Returns a header from GetHeaderInformationL() back to the decoder so that
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
//the memory can be freed.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
void CAriMpeg4aspdecHwDevice::ReturnHeader( TVideoPictureHeader* aHeader )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
	if ( !iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
		if ( iVideoPictureHeader == aHeader )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
			delete iVideoPictureHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
            iVideoPictureHeader = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
			iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
//Sets the device input format to a compressed video format.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
void CAriMpeg4aspdecHwDevice::SetInputFormatL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
								   const CCompressedVideoFormat& aFormat,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
								   TVideoDataUnitType aDataUnitType,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
								   TVideoDataUnitEncapsulation aEncapsulation,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
								   TBool aDataInOrder )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
	if ( !iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
		if ( ( !aDataInOrder ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
             ( aEncapsulation == EDuGenericPayload ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
             ( aEncapsulation == EDuRtpPayload ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
             ( aDataUnitType == EDuArbitraryStreamSection ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
             User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
		if ( ( aFormat.MimeType().FindF( KMPEG4SupportedMimeType ) !=
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
															KErrNotFound ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
			( aFormat.MimeType().FindF( KH263SupportedMimeType ) !=
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
														    KErrNotFound ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
			( aFormat.MimeType().FindF( KH26398SupportedMimeType ) !=
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
														    KErrNotFound ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
			iInputFormat = CCompressedVideoFormat::NewL( aFormat );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
			iDataUnitType  = aDataUnitType;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
			iEncapsulation = aEncapsulation;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
			PRINT_ERR( "aFormat is not supported \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
			User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
		PRINT_ERR( "istate is not initialized yet\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
//Sets whether decoding should be synchronized to the current clock source,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
//if any, or if pictures should instead be decoded as soon as possible.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
//If decoding is synchronized, decoding timestamps are used if available,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
//presentation timestamps are used if not. When decoding is not synchronized,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
//pictures are decoded as soon as source data is available for them, and the
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
//decoder has a free output buffer. If a clock source is not available,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
//decoding will not be synchronized.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
void CAriMpeg4aspdecHwDevice::SynchronizeDecoding( TBool /*aSynchronize*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
//Sets the Buffer Options as specified by the client.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
void CAriMpeg4aspdecHwDevice::SetBufferOptionsL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
						const CMMFDevVideoPlay::TBufferOptions& aOptions )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
	if ( !iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
		TTimeIntervalMicroSeconds zerotime( 0 );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
        if ( ( aOptions.iMinNumInputBuffers < KMinInputBuffers ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
             ( aOptions.iPreDecodeBufferSize != 0 ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
             ( aOptions.iMaxPostDecodeBufferSize != 0 ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
             ( aOptions.iPreDecoderBufferPeriod != zerotime ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
             ( aOptions.iPostDecoderBufferPeriod != zerotime ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
        	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
            User::Leave( KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
        	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
		if ( ( aOptions.iMinNumInputBuffers > KMaxInputBuffers ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
               ( aOptions.iMaxInputBufferSize > KMaxInputBufferSize ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
		    User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
		iBufferOptions = aOptions;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
		PRINT_ERR( "istate is not initialized yet\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
//Gets the video decoder buffer options actually in use.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
void CAriMpeg4aspdecHwDevice::GetBufferOptions(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
								CMMFDevVideoPlay::TBufferOptions& aOptions )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
	if ( !iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
		aOptions = iBufferOptions;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
//Indicates which HRD/VBV specification is fulfilled in the input stream and
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
//any related parameters.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
void CAriMpeg4aspdecHwDevice::SetHrdVbvSpec(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
								THrdVbvSpecification /*aHrdVbvSpec*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
								const TDesC8& /*aHrdVbvParams*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
//Sets the output post-processor device to use.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
void CAriMpeg4aspdecHwDevice::SetOutputDevice(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
										CMMFVideoPostProcHwDevice* aDevice )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
	if ( !iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
		if ( !aDevice )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
			iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
			iOutputDevice = aDevice;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
			// checks whether customBuffer supported by o/p device
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
            iCustomBufferHandle =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
             ( MMmfVideoBufferManagement* )( iOutputDevice->CustomInterface(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
										KMmfVideoBuffermanagementUid ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
		PRINT_ERR( "istate is not initialized yet, "
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
				"calling MdvppFatalError on iMMFDevVideoPlayProxy\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
//Returns the current decoding position, i.e.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
//the timestamp for the most recently decoded picture.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
TTimeIntervalMicroSeconds CAriMpeg4aspdecHwDevice::DecodingPosition()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
	if ( iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
		PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
		return iDecodingPosition;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
		PRINT_ERR( "iState is not initialised, calling  MdvppFatalError\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
		PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
		return ( TTimeIntervalMicroSeconds( 0 ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
//Returns the current pre-decoder buffer size.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
TUint CAriMpeg4aspdecHwDevice::PreDecoderBufferBytes()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
    if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
        iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
        PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
		return ( 0 );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
    return 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
//Reads various counters related to the received input bitstream
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
//and coded data units.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
void CAriMpeg4aspdecHwDevice::GetBitstreamCounters(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
							CMMFDevVideoPlay::TBitstreamCounters& aCounters )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
	if ( iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
		aCounters = iBitstreamCounters;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
		//Reset the counters to Zero
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
		iBitstreamCounters.iLostPackets = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
		iBitstreamCounters.iTotalPackets = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
		PRINT_ERR( "iState is not initialised, calling  MdvppFatalError\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   538
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
//Retrieves the number of free input buffers the decoder has available
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
TUint CAriMpeg4aspdecHwDevice::NumFreeBuffers()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   544
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
	if ( iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   547
		if ( iNumberOfInputBuffersAllocated == 0 )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
		    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
		    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
		    return ( iBufferOptions.iMinNumInputBuffers );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
		    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
		    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
		    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
		    return  ( iInputFreeBufferQueue.Count() );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
		    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
		PRINT_ERR( "iState is not initialised, calling  MdvppFatalError\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
		PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
		return( KErrNone );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   564
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   567
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
//Returns an input buffer of size aBufferSize. If no buffer is available
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   569
//then NULL is returned.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   570
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   572
TVideoInputBuffer* CAriMpeg4aspdecHwDevice::GetBufferL( TUint aBufferSize )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
	if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
        PRINT_ERR( "istate is not initialized yet\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
        User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   581
    if ( iState->IsInputEndPending() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
	    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
	    PRINT_ERR( "input is pending\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   584
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   585
	    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   587
    if ( aBufferSize > iBufferOptions.iMaxInputBufferSize )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
        PRINT_ERR( "aBufferSize is more than the allowed size\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   590
    	PRINT_MSG( LEVEL_HIGH, ( "reqBufSize = %d, maxAllowedBufSize = %d",
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
    			aBufferSize, iBufferOptions.iMaxInputBufferSize ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
        User::Leave( KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   593
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   595
	TVideoInputBuffer *inBuffer = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   597
    if ( iNumberOfInputBuffersAllocated ==
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   598
								iBufferOptions.iMinNumInputBuffers )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   599
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
        if ( iInputFreeBufferQueue.Count() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   602
            // Reallocate the input buffer if needed
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   603
            PRINT_MSG( LEVEL_HIGH, ( "Reallocate input buffer if needed" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   604
			CreateInputBufferL( aBufferSize, ETrue );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   605
			inBuffer = iInputFreeBufferQueue[0];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   606
			iInputFreeBufferQueue.Remove( 0 );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   607
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   608
        else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   609
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   610
            PRINT_ERR( "No input free buffers available \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   611
            return NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   612
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   613
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   614
    else if ( iNumberOfInputBuffersAllocated <
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   615
									iBufferOptions.iMinNumInputBuffers )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   616
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   617
        // Allocate new buffer of the requested size
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   618
        //PRINT_ERR( "CreateInputBufferL returned EFALSE\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   619
        CreateInputBufferL( aBufferSize, EFalse );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   620
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   621
        // remove the last created buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   622
        inBuffer = iInputFreeBufferQueue[ iInputFreeBufferQueue.Count() - 1];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   623
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   624
        iInputFreeBufferQueue.Remove( iInputFreeBufferQueue.Count() - 1 );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   625
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   626
    else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   627
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   628
        PRINT_ERR( "iNumberOfInputBuffersAllocated is less "
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   629
        		"			iBufferOptions.iMinNumInputBuffers\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   630
        User::Leave( KErrGeneral );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   631
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   632
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   633
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   634
	return inBuffer;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   635
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   636
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   637
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   638
//Called by DevVideoPlay to write the coded data.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   639
//Writes a piece of coded video data to the decoder. The data buffer must
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   640
//be retrieved from the decoder with GetBufferL()..
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   641
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   642
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   643
void CAriMpeg4aspdecHwDevice::WriteCodedDataL( TVideoInputBuffer* aBuffer )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   644
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   645
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   646
	if ( !iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   647
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   648
		PRINT_ERR( "istate is not initialized yet \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   649
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   650
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   651
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   652
    if ( !aBuffer )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   653
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   654
		PRINT_ERR( "aBuffer is null \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   655
		User::Leave( KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   656
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   657
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   658
    if ( aBuffer->iData.Length() == 0 )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   659
	    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   660
	    PRINT_ERR( "length of aBuffer is zero \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   661
		User::Leave( KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   662
	    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   663
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   664
	if ( iState->IsInputEndPending() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   665
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   666
		PRINT_ERR( "IsInputEndPending is true \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   667
		User::Leave( KErrEof );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   668
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   669
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   670
	if ( ( iDataUnitType == EDuSeveralSegments ) ||
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   671
			( iDataUnitType == EDuVideoSegment ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   672
	    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   673
		iBitstreamCounters.iTotalPackets++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   674
	    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   675
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   676
	// if custom interface is supported by o/p device get all the buffers
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   677
	// and add it to Engine
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   678
	if ( !iOutputBuffersCreated )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   679
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   680
		// Set Stream information
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   681
		if ( !iDecoderConfigured )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   682
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   683
    		iCodec->ConfigDecoderL( &( aBuffer->iData ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   684
			// set input & output formats to Codec
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   685
			iCodec->SetFormatsL( iDataUnitType, iOutputFormat );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   686
            iDecoderConfigured = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   687
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   688
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   689
    	if ( !iCustomBufferHandle )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   690
    		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   691
			// Get o/p buffer length for creation
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   692
			iOutputBufferSize = iCodec->GetOutputBufferLength();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   693
			CreateOutputBuffersL();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   694
    		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   695
		iOutputBuffersCreated = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   696
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   697
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   698
	// add all the o/p buffers to engine
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   699
	if ( !iBufferAdded )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   700
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   701
		if ( iCustomBufferHandle )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   702
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   703
			TVideoPicture* videoPicture = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   704
			for ( TInt i = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   705
				  i < TInt( iCustomBufferOptions->iNumInputBuffers );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   706
				  i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   707
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   708
				videoPicture = iCustomBufferHandle->MmvbmGetBufferL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   709
										iCustomBufferOptions->iBufferSize );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   710
				if ( videoPicture )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   711
					{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   712
					TRAPD( lErr, videoPicture->iHeader =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   713
									new ( ELeave ) TVideoPictureHeader ) ;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   714
					if ( lErr != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   715
                    	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   716
                    	iCustomBufferHandle->MmvbmReleaseBuffer(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   717
															  videoPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   718
                    	iMMFDevVideoPlayProxy->MdvppFatalError( this,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   719
															  KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   720
                    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   721
                    else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   722
                    	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   723
					    iEngine->AddOutput( videoPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   724
                    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   725
					}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   726
				else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   727
					{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   728
					break;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   729
					}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   730
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   731
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   732
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   733
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   734
			for ( TInt i = 0; i < iOutputFreeBufferQueue.Count(); i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   735
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   736
				iEngine->AddOutput( iOutputFreeBufferQueue[0] );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   737
				iOutputFreeBufferQueue.Remove( 0 );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   738
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   739
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   740
		iBufferAdded = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   741
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   742
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   743
	iPictureCounters.iTotalPictures++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   744
	iFilledBufferCounter++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   745
	TInt err = iEngine->AddInput( aBuffer );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   746
	PRINT_MSG( LEVEL_LOW, ( "WriteCodedDataL, addinput err = %d", err ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   747
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   748
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   749
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   750
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   751
#ifdef SYMBIAN_MDF_API_V2
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   752
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   753
//Configures the Mpeg4/H263 decoder by passing the required header
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   754
//information for the stream that is getting decoded. The header
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   755
//structurespecific  to the Decoder is passed as iOptional member.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   756
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   757
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   758
void CAriMpeg4aspdecHwDevice::ConfigureDecoderL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   759
							const TVideoPictureHeader& aVideoPictureHeader )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   760
    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   761
    PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   762
	if ( iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   763
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   764
		PRINT_ERR( "iState is already initialised \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   765
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   766
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   767
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   768
    TInt level = aVideoPictureHeader.iLevel;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   769
    PRINT_MSG( LEVEL_LOW, ( "ConfigureDecoderL,level = %d \n", level ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   770
    if ( aVideoPictureHeader.iOptional )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   771
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   772
        // Mpeg-4
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   773
        switch ( level )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   774
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   775
			case 0:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   776
			case KMP4Level11: //level 0b
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   777
			case KMP4Level1:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   778
			case KMP4Level2:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   779
			case KMP4Level3:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   780
			case KMP4Level4:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   781
			case KMP4Level5:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   782
			case -1:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   783
				break;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   784
			default:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   785
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   786
				PRINT_ERR( "level is not supported \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   787
				User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   788
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   789
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   790
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   791
    else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   792
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   793
        // H.263
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   794
        switch ( level )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   795
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   796
			case KH263Level10:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   797
			case KH263Level20:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   798
			case KH263Level30:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   799
			case KH263Level45:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   800
			case -1:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   801
				break;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   802
			default:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   803
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   804
				PRINT_ERR( "level is not supported \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   805
				User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   806
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   807
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   808
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   809
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   810
	// Create Codec and configure the decoder
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   811
	iCodec = CAriMpeg4aspdecWrapper::NewL( this );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   812
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   813
	// configure the decoder in case of mpeg-4 otherwise ie in
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   814
	// case of h.263 wait till the first call of WriteCodedDataL()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   815
    if ( aVideoPictureHeader.iOptional )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   816
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   817
	    iCodec->ConfigDecoderL( aVideoPictureHeader.iOptional );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   818
    	iDecoderConfigured = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   819
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   820
    iConfigureDecoderCalled = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   821
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   822
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   823
    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   824
#endif
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   825
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   826
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   827
//Retrieves post-processing information about this hardware device.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   828
//The device creates a CPostProcessorInfo structure, fills it with correct
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   829
//data, pushes it to the cleanup stack and returns it. The client will
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   830
//delete the object when it is no longer needed.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   831
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   832
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   833
CPostProcessorInfo* CAriMpeg4aspdecHwDevice::PostProcessorInfoLC()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   834
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   835
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   836
	//Aricent decoder does not support any post processing functionality
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   837
	RArray<TUncompressedVideoFormat> supportedFormats;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   838
	CleanupClosePushL( supportedFormats );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   839
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   840
	RArray<TUint32> supportedCombinations;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   841
	CleanupClosePushL( supportedCombinations );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   842
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   843
	TYuvToRgbCapabilities yuvToRgbCapabilities;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   844
	RArray<TScaleFactor> supportedScaleFactors;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   845
	CleanupClosePushL( supportedScaleFactors );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   846
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   847
	yuvToRgbCapabilities.iSamplingPatterns = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   848
	yuvToRgbCapabilities.iCoefficients = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   849
	yuvToRgbCapabilities.iRgbFormats = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   850
	yuvToRgbCapabilities.iLightnessControl = EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   851
	yuvToRgbCapabilities.iSaturationControl = EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   852
	yuvToRgbCapabilities.iContrastControl = EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   853
	yuvToRgbCapabilities.iGammaCorrection = EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   854
	yuvToRgbCapabilities.iDitherTypes = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   855
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   856
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   857
	CPostProcessorInfo* info = CPostProcessorInfo::NewL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   858
		KUidMp4H263DecoderHwDevice,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   859
		KManufacturer,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   860
		KIdentifier,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   861
		TVersion( 1, 0, 0 ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   862
		supportedFormats.Array(),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   863
		supportedCombinations.Array(),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   864
		//Accelerated or not
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   865
		EFalse,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   866
		//supports DSA
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   867
		EFalse,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   868
		yuvToRgbCapabilities,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   869
		//supported rotations
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   870
		ERotateNone,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   871
		//supports Arbitrary scaling
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   872
		EFalse,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   873
		supportedScaleFactors.Array(),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   874
		//supports antialiased scaling
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   875
		EFalse );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   876
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   877
	CleanupStack::PushL( info );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   878
	CleanupStack::Pop( &supportedScaleFactors );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   879
	supportedScaleFactors.Close();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   880
	CleanupStack::Pop( &supportedCombinations );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   881
	supportedCombinations.Close();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   882
	CleanupStack::Pop( &supportedFormats );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   883
	supportedFormats.Close();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   884
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   885
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   886
	return info;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   887
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   888
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   889
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   890
//Retrieves the list of the output formats that the device supports.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   891
//The list can depend on the device source format, and therefore
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   892
//SetSourceFormatL() must be called before calling this method.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   893
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   894
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   895
void CAriMpeg4aspdecHwDevice::GetOutputFormatListL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   896
								RArray<TUncompressedVideoFormat>& aFormats )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   897
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   898
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   899
    if ( iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   900
    	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   901
    	PRINT_ERR( "iState is already initialised \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   902
        User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   903
    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   904
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   905
    if ( !iInputFormat )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   906
	    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   907
		//Input format should be set before calling this function, as output
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   908
        // format is decided based on input format
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   909
	    PRINT_ERR( "iInputFormat is not set yet \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   910
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   911
	    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   912
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   913
	TUncompressedVideoFormat format;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   914
	format.iDataFormat = EYuvRawData;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   915
	format.iYuvFormat.iYuv2RgbMatrix = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   916
	format.iYuvFormat.iRgb2YuvMatrix = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   917
	format.iYuvFormat.iAspectRatioNum = 1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   918
	format.iYuvFormat.iAspectRatioDenom = 1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   919
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   920
	aFormats.Reset();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   921
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   922
    //The following formats are supported by both H.263 and Mpeg-4
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   923
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   924
	//YUV 420 Chroma0 Planar
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   925
	format.iYuvFormat.iCoefficients = EYuvBt601Range0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   926
	format.iYuvFormat.iPattern      = EYuv420Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   927
	format.iYuvFormat.iDataLayout   = EYuvDataPlanar;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   928
	aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   929
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   930
    //YUV 422 Chroma LE Interleaved
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   931
    format.iYuvFormat.iPattern      = EYuv422Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   932
	format.iYuvFormat.iDataLayout   = EYuvDataInterleavedLE;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   933
    aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   934
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   935
    //YUV 422 Chroma BE Interleaved
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   936
    format.iYuvFormat.iDataLayout   = EYuvDataInterleavedBE;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   937
    aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   938
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   939
    //The following formats are only supported by Mpeg-4
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   940
    if ( iInputFormat->MimeType().FindF( KMPEG4SupportedMimeType ) !=
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   941
															   KErrNotFound )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   942
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   943
        //BT 601.5 Full Range
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   944
        // YUV 420 Chroma0 Planar
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   945
        format.iYuvFormat.iCoefficients = EYuvBt601Range1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   946
	    format.iYuvFormat.iPattern      = EYuv420Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   947
	    format.iYuvFormat.iDataLayout   = EYuvDataPlanar;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   948
        aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   949
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   950
        //YUV 422 Chroma LE Interleaved
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   951
        format.iYuvFormat.iPattern      = EYuv422Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   952
	    format.iYuvFormat.iDataLayout   = EYuvDataInterleavedLE;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   953
        aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   954
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   955
        //YUV 422 Chroma BE Interleaved
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   956
        format.iYuvFormat.iDataLayout   = EYuvDataInterleavedBE;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   957
        aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   958
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   959
        //BT 709 Reduced Range
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   960
	    // YUV 420 Chroma0 Planar
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   961
	    format.iYuvFormat.iCoefficients = EYuvBt709Range0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   962
	    format.iYuvFormat.iPattern      = EYuv420Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   963
	    format.iYuvFormat.iDataLayout   = EYuvDataPlanar;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   964
	    aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   965
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   966
        //YUV 422 Chroma LE Interleaved
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   967
        format.iYuvFormat.iPattern      = EYuv422Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   968
	    format.iYuvFormat.iDataLayout   = EYuvDataInterleavedLE;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   969
        aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   970
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   971
        //YUV 422 Chroma BE Interleaved
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   972
        format.iYuvFormat.iDataLayout   = EYuvDataInterleavedBE;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   973
        aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   974
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   975
        //BT 709 Full Range
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   976
        // YUV 420 Chroma0 Planar
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   977
	    format.iYuvFormat.iCoefficients = EYuvBt709Range1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   978
	    format.iYuvFormat.iPattern      = EYuv420Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   979
	    format.iYuvFormat.iDataLayout   = EYuvDataPlanar;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   980
	    aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   981
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   982
        //YUV 422 Chroma LE Interleaved
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   983
        format.iYuvFormat.iPattern      = EYuv422Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   984
	    format.iYuvFormat.iDataLayout   = EYuvDataInterleavedLE;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   985
        aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   986
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   987
        //YUV 422 Chroma BE Interleaved
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   988
        format.iYuvFormat.iDataLayout   = EYuvDataInterleavedBE;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   989
        aFormats.Append( format );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   990
	    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   991
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   992
    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   993
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   994
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   995
// Sets the device output format.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   996
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   997
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   998
void CAriMpeg4aspdecHwDevice::SetOutputFormatL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   999
									const TUncompressedVideoFormat &aFormat )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1000
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1001
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1002
    if ( iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1003
    	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1004
    	PRINT_ERR( "istate is already initialised \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1005
        User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1006
    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1007
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1008
    if ( !iInputFormat )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1009
	    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1010
		//Input format should be set before calling this function, as output
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1011
        // format is decided based on input format
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1012
	    PRINT_ERR( "iInputFormat is not set yet \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1013
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1014
	    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1015
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1016
	// check whether output format is supported or not.if not supported leave
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1017
	RArray<TUncompressedVideoFormat> formats;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1018
	CleanupClosePushL( formats );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1019
	GetOutputFormatListL( formats );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1020
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1021
	TBool flag = EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1022
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1023
	for ( TInt i = 0; i < formats.Count(); i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1024
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1025
		if ( aFormat == formats[i] )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1026
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1027
			flag = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1028
			break;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1029
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1030
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1031
	CleanupStack::Pop ( &formats );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1032
    formats.Close();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1033
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1034
	if ( !flag )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1035
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1036
		PRINT_ERR( "outputformat is not supported \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1037
        User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1038
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1039
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1040
    iOutputFormat = aFormat;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1041
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1042
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1043
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1044
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1045
// Sets the clock source to use for video timing.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1046
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1047
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1048
void CAriMpeg4aspdecHwDevice::SetClockSource( MMMFClockSource* /*aClock*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1049
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1050
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1051
    if ( iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1052
    	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1053
    	PRINT_ERR( "iState is initialised,calling MdvppFatalError \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1054
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1055
    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1056
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1057
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1058
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1059
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1060
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1061
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1062
// Sets the device video output destination.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1063
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1064
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1065
void CAriMpeg4aspdecHwDevice::SetVideoDestScreenL( TBool aScreen )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1066
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1067
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1068
	if ( !iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1069
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1070
		if ( aScreen )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1071
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1072
			PRINT_ERR( "KErrNotSupported \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1073
			User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1074
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1075
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1076
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1077
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1078
		PRINT_ERR( "KErrNotSupported \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1079
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1080
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1081
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1082
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1083
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1084
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1085
// Sets the post-processing types to be used.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1086
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1087
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1088
void CAriMpeg4aspdecHwDevice::SetPostProcessTypesL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1089
										TUint32 /*aPostProcCombination*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1090
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1091
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1092
	PRINT_ERR( "KErrNotSupported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1093
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1094
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1095
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1096
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1097
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1098
// Sets post-processing options for input (pan-scan ) cropping.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1099
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1100
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1101
void CAriMpeg4aspdecHwDevice::SetInputCropOptionsL( const TRect& /*aRect*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1102
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1103
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1104
	PRINT_ERR( "KErrNotSupported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1105
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1106
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1107
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1108
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1109
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1110
// Sets post-processing options for YUV to RGB color space conversion
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1111
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1112
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1113
void CAriMpeg4aspdecHwDevice::SetYuvToRgbOptionsL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1114
								    const TYuvToRgbOptions& /*aOptions*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1115
									const TYuvFormat& /*aYuvFormat*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1116
									TRgbFormat /*aRgbFormat*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1117
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1118
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1119
	PRINT_ERR( "KErrNotSupported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1120
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1121
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1122
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1123
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1124
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1125
// Sets post-processing options for YUV to RGB color space conversion. Uses
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1126
//the device input and output formats.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1127
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1128
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1129
void CAriMpeg4aspdecHwDevice::SetYuvToRgbOptionsL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1130
									const TYuvToRgbOptions& /*aOptions*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1131
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1132
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1133
	PRINT_ERR( "KErrNotSupported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1134
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1135
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1136
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1137
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1138
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1139
// Sets post-processing options for rotation. SetPostProcessTypesL() must be
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1140
//called before this method is used.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1141
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1142
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1143
void CAriMpeg4aspdecHwDevice::SetRotateOptionsL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1144
											TRotationType /*aRotationType*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1145
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1146
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1147
	PRINT_ERR( "KErrNotSupported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1148
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1149
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1150
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1151
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1152
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1153
//Sets post-processing options for scaling. SetPostProcessTypesL() must be
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1154
//called before this method is used.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1155
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1156
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1157
void CAriMpeg4aspdecHwDevice::SetScaleOptionsL( const TSize& /*aTargetSize*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1158
											 TBool /*aAntiAliasFiltering*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1159
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1160
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1161
	PRINT_ERR( "KErrNotSupported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1162
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1163
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1164
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1165
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1166
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1167
//Sets post-processing options for output cropping.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1168
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1169
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1170
void CAriMpeg4aspdecHwDevice::SetOutputCropOptionsL( const TRect& /*aRect*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1171
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1172
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1173
	PRINT_ERR( "KErrNotSupported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1174
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1175
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1176
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1177
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1178
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1179
//Sets post-processing plug-in specific options.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1180
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1181
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1182
void CAriMpeg4aspdecHwDevice::SetPostProcSpecificOptionsL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1183
												const TDesC8& /*aOptions*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1184
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1185
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1186
	PRINT_ERR( "KErrNotSupported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1187
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1188
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1189
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1190
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1191
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1192
//Initializes the device. This method is asynchronous, the device calls
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1193
//MdvppInitializeComplete() of MMFVideoPlayProxy after initialization has
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1194
//completed. After this method has successfully completed, further
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1195
//configuration changes are not possible except where separately noted.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1196
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1197
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1198
void CAriMpeg4aspdecHwDevice::Initialize()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1199
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1200
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1201
    if ( !iState->IsTransitionValid( CStateMachine::EInitializeCommand ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1202
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1203
		PRINT_ERR( "state is not valid in statemachine \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1204
		iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1205
        return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1206
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1207
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1208
    TRAPD( err, iInputFreeBuffers	=
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1209
	  new ( ELeave ) TVideoInputBuffer[iBufferOptions.iMinNumInputBuffers] );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1210
    if ( err )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1211
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1212
        iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, err );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1213
        PRINT_ERR( "creation of iInputFreeBuffers returned error\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1214
		return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1215
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1216
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1217
	iPictureCounters.iPicturesDisplayed = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1218
	iPictureCounters.iPicturesSkipped = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1219
	iPictureCounters.iTotalPictures = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1220
	iPictureCounters.iPicturesDecoded = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1221
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1222
	iBitstreamCounters.iLostPackets = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1223
	iBitstreamCounters.iTotalPackets = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1224
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1225
	// if custom interface is supported then enable the interface
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1226
	if ( iCustomBufferHandle )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1227
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1228
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1229
		TRAP( err, iCustomBufferOptions =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1230
		          new ( ELeave ) MMmfVideoBufferManagement::TBufferOptions );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1231
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1232
		if ( err != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1233
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1234
			iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, err );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1235
			PRINT_ERR( "creation of iCustomBuffeOptions returned error \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1236
			return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1237
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1238
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1239
		iCustomBufferOptions->iNumInputBuffers = KMaxOutputBuffers + 1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1240
		iCustomBufferOptions->iBufferSize = TSize( KMaxFrameWidth,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1241
												   KMaxFrameHeight );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1242
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1243
		iCustomBufferHandle->MmvbmSetObserver(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1244
							( MMmfVideoBufferManagementObserver * )this );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1245
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1246
		iCustomBufferHandle->MmvbmEnable( ETrue );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1247
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1248
		TRAP( err,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1249
		iCustomBufferHandle->MmvbmSetBufferOptionsL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1250
											       *iCustomBufferOptions ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1251
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1252
		if ( err != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1253
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1254
			PRINT_ERR( "iCustomBufferHandle->MmvbmSetBufferOptionsL \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1255
			iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, err );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1256
			return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1257
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1258
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1259
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1260
	if ( !iConfigureDecoderCalled )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1261
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1262
        TRAP( err, iCodec = CAriMpeg4aspdecWrapper::NewL( this ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1263
        if ( err != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1264
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1265
		    iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, err );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1266
		    PRINT_ERR( "CCodecInterface::NewL returned error \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1267
		    return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1268
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1269
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1270
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1271
	// Engine Creation
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1272
	TRAP( err, iEngine = CBaseEngine::NewL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1273
								     this, ( MBaseCodec* )iCodec, EFalse ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1274
	if ( err != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1275
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1276
		iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, err );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1277
		PRINT_ERR( "CBaseEngine::NewL returned error \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1278
		return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1279
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1280
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1281
	// set input & output formats to Codec
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1282
	if ( iConfigureDecoderCalled )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1283
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1284
		TRAP( err, iCodec->SetFormatsL(  iDataUnitType, iOutputFormat ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1285
        if ( err != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1286
            {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1287
		    iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, err );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1288
		    PRINT_ERR( "iCodec->SetFormatsL returned error \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1289
		    return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1290
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1291
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1292
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1293
	err = iState->Transit( CStateMachine::EInitializeCommand );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1294
	if ( err )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1295
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1296
		iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, err );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1297
		PRINT_ERR( "state is not set to initialised \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1298
		return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1299
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1300
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1301
	iMMFDevVideoPlayProxy->MdvppInitializeComplete( this, KErrNone );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1302
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1303
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1304
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1305
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1306
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1307
//Commit all changes since the last CommitL(), Revert() or Initialize()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1308
//to the hardware device. This only applies to methods which can be called
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1309
//both before AND after DevVideoPlay has been initialized.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1310
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1311
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1312
void CAriMpeg4aspdecHwDevice::CommitL()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1313
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1314
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1315
    if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1316
	    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1317
	    PRINT_ERR( "istate is not initialised yet \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1318
		User::Leave( KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1319
	    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1320
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1321
    return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1322
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1323
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1324
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1325
//Revert all changes since the last CommitL(), Revert() or Initialize() back
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1326
//to their previous settings. This only applies to methods which can be
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1327
//called both before AND after DevVideoPlay has been initialized..
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1328
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1329
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1330
void CAriMpeg4aspdecHwDevice::Revert()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1331
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1332
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1333
    if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1334
	    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1335
	    PRINT_ERR( "istate is not initialised yet \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1336
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1337
	    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1338
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1339
    return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1340
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1341
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1342
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1343
//Not Supported.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1344
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1345
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1346
void CAriMpeg4aspdecHwDevice::StartDirectScreenAccessL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1347
										const TRect& /*aVideoRect*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1348
										CFbsScreenDevice& /*aScreenDevice*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1349
										const TRegion& /*aClipRegion*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1350
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1351
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1352
	PRINT_ERR( "Not supported API \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1353
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1354
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1355
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1356
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1357
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1358
//Not Supported.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1359
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1360
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1361
void CAriMpeg4aspdecHwDevice::SetScreenClipRegion( const TRegion& /*aRegion*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1362
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1363
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1364
	PRINT_ERR( "Not supported API \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1365
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1366
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1367
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1368
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1369
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1370
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1371
//Not Supported.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1372
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1373
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1374
void CAriMpeg4aspdecHwDevice::SetPauseOnClipFail( TBool /*aPause*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1375
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1376
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1377
	PRINT_ERR( "Not supported API \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1378
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1379
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1380
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1381
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1382
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1383
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1384
//Not Supported.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1385
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1386
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1387
void CAriMpeg4aspdecHwDevice::AbortDirectScreenAccess()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1388
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1389
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1390
	PRINT_ERR( "Not supported API \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1391
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1392
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1393
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1394
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1395
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1396
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1397
//Indicates whether playback is proceeding. This method can be used to check
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1398
//whether playback was paused or not in response to a new clipping region
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1399
//or DSA abort
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1400
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1401
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1402
TBool CAriMpeg4aspdecHwDevice::IsPlaying()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1403
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1404
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1405
	if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1406
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1407
		 PRINT_ERR( "istate is not initialised yet \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1408
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1409
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1410
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1411
	return ( iState->IsStarted() );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1412
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1413
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1414
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1415
//Not Supported.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1416
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1417
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1418
void CAriMpeg4aspdecHwDevice::Redraw()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1419
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1420
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1421
	PRINT_ERR( "Not supported API \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1422
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1423
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1424
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1425
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1426
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1427
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1428
//Starts video playback, including decoding, post-processing, and rendering.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1429
//Playback will proceed until it has been stopped or paused, or the end of
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1430
//the bitstream is reached.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1431
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1432
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1433
void CAriMpeg4aspdecHwDevice::Start()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1434
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1435
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1436
    if ( iState->IsPlaying() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1437
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1438
		PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1439
		PRINT_ERR( "already in playing state \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1440
		return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1441
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1442
	if ( !iState->IsTransitionValid( CStateMachine::EStartCommand ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1443
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1444
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1445
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1446
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1447
	iDecodingPosition = TTimeIntervalMicroSeconds( 0 );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1448
	iEngine->Start();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1449
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1450
	TInt error = iState->Transit( CStateMachine::EStartCommand );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1451
	if ( error != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1452
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1453
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1454
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1455
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1456
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1457
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1458
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1459
//Stops video playback. No new pictures will be decoded, post-processed,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1460
//or rendered.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1461
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1462
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1463
void CAriMpeg4aspdecHwDevice::Stop()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1464
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1465
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1466
    if ( iState->IsStopped() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1467
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1468
        PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1469
        PRINT_ERR( "already in stopped state \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1470
        return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1471
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1472
	if ( !iState->IsTransitionValid( CStateMachine::EStopCommand ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1473
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1474
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1475
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1476
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1477
	iPictureNumber = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1478
	// Stop & Reset the Engine
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1479
	iEngine->Stop();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1480
	iEngine->Reset();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1481
	iBufferAdded			= EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1482
	iFilledBufferCounter	= 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1483
	iInputEndCalled			= EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1484
	iNoLastOut				= EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1485
	iInputBufferConsumedCounter = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1486
	TInt error = iState->Transit( CStateMachine::EStopCommand );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1487
	if ( error != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1488
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1489
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1490
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1491
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1492
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1493
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1494
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1495
//Pauses video playback, including decoding, post-processing, and rendering.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1496
//No pictures will be decoded, post-processed, or rendered until playback has
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1497
//been resumed.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1498
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1499
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1500
void CAriMpeg4aspdecHwDevice::Pause()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1501
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1502
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1503
    if ( iState->IsPaused() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1504
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1505
        PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1506
        PRINT_ERR( "already in paused state \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1507
        return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1508
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1509
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1510
	if ( !iState->IsTransitionValid( CStateMachine::EPauseCommand ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1511
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1512
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1513
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1514
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1515
	//Stop the Engine
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1516
	iEngine->Stop();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1517
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1518
	TInt error = iState->Transit( CStateMachine::EPauseCommand );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1519
	if ( error != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1520
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1521
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1522
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1523
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1524
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1525
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1526
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1527
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1528
//Resumes video playback after a pause.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1529
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1530
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1531
void CAriMpeg4aspdecHwDevice::Resume()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1532
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1533
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1534
    if ( iState->IsPlaying() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1535
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1536
        PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1537
        PRINT_ERR( "already in playing state \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1538
        return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1539
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1540
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1541
	if ( !iState->IsTransitionValid( CStateMachine::EResumeCommand ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1542
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1543
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1544
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1545
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1546
	// Start The Engine
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1547
	iEngine->Start();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1548
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1549
	TInt error = iState->Transit( CStateMachine::EResumeCommand );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1550
	if ( error != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1551
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1552
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1553
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1554
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1555
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1556
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1557
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1558
//Changes to a new decoding and playback position,used for randomly accessing
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1559
//(seeking)the input stream. The position change flushes all input and output
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1560
//buffers. Pre-decoder and post-decoder buffering are handled as if a new
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1561
//bitstream was being decoded. If the device still has buffered pictures that
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1562
//precede the new playback position, they will be discarded. If playback is
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1563
//synchronized to a clock source, the client is responsible for setting the
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1564
//clock source to the new position..
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1565
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1566
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1567
void CAriMpeg4aspdecHwDevice::SetPosition(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1568
						const TTimeIntervalMicroSeconds& aPlaybackPosition )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1569
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1570
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1571
	//Start Decoding from new position
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1572
	if ( iState->IsInitialized() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1573
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1574
		iEngine->Stop();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1575
		iEngine->Reset();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1576
        iDecodingPosition = aPlaybackPosition;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1577
		iBufferAdded = EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1578
		iEngine->Start();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1579
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1580
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1581
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1582
		PRINT_ERR( "istate is not initialised yet\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1583
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1584
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1585
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1586
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1587
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1588
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1589
//Not Supported.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1590
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1591
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1592
void CAriMpeg4aspdecHwDevice::FreezePicture(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1593
							const TTimeIntervalMicroSeconds& /*aTimestamp*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1594
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1595
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1596
	PRINT_ERR( "not supported API \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1597
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1598
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1599
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1600
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1601
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1602
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1603
//Not Supported.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1604
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1605
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1606
void CAriMpeg4aspdecHwDevice::ReleaseFreeze(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1607
							const TTimeIntervalMicroSeconds& /*aTimestamp*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1608
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1609
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1610
	PRINT_ERR( "not supported API \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1611
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1612
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1613
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1614
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1615
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1616
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1617
//Returns the current playback position, i.e. the timestamp for the most
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1618
//recently displayed or virtually displayed picture. If the device output
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1619
//is written to another device, the most recent output picture is used
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1620
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1621
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1622
TTimeIntervalMicroSeconds CAriMpeg4aspdecHwDevice::PlaybackPosition()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1623
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1624
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1625
	// In Decoder case decoding position is same as playback position
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1626
	if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1627
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1628
		PRINT_ERR( "iState is not initialised \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1629
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1630
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1631
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1632
	return iDecodingPosition;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1633
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1634
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1635
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1636
//Returns the total amount of memory allocated for uncompressed pictures.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1637
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1638
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1639
TUint CAriMpeg4aspdecHwDevice::PictureBufferBytes()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1640
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1641
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1642
	if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1643
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1644
		PRINT_ERR( "iState is not initialised yet \n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1645
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1646
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1647
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1648
	return( KMaxOutputBuffers * iOutputBufferSize );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1649
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1650
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1651
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1652
//Reads various counters related to decoded pictures.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1653
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1654
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1655
void CAriMpeg4aspdecHwDevice::GetPictureCounters(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1656
							CMMFDevVideoPlay::TPictureCounters& aCounters )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1657
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1658
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1659
    if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1660
    	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1661
		PRINT_ERR( "iState is not initialised yet\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1662
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1663
    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1664
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1665
	aCounters = iPictureCounters;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1666
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1667
	//Reset the counters to Zero
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1668
	iPictureCounters.iPicturesDisplayed = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1669
	iPictureCounters.iPicturesSkipped = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1670
	iPictureCounters.iTotalPictures = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1671
	iPictureCounters.iPicturesDecoded = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1672
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1673
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1674
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1675
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1676
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1677
//Not supported API.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1678
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1679
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1680
void CAriMpeg4aspdecHwDevice::SetComplexityLevel( TUint /*aLevel*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1681
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1682
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1683
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1684
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1685
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1686
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1687
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1688
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1689
//Not supported API.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1690
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1691
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1692
TUint CAriMpeg4aspdecHwDevice::NumComplexityLevels()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1693
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1694
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1695
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1696
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1697
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1698
	return 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1699
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1700
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1701
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1702
//Not supported API.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1703
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1704
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1705
void CAriMpeg4aspdecHwDevice::GetComplexityLevelInfo( TUint /*aLevel*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1706
						CMMFDevVideoPlay::TComplexityLevelInfo& /*aInfo*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1707
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1708
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1709
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1710
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1711
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1712
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1713
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1714
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1715
//Called by the Post Proc hwdevice when a picture is displayed on the screen.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1716
//Returns a picture back to the device.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1717
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1718
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1719
void CAriMpeg4aspdecHwDevice::ReturnPicture( TVideoPicture* aPicture )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1720
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1721
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1722
    if ( !( iState->IsInitialized() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1723
    	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1724
    	PRINT_ERR( "iState is not initialised yet\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1725
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1726
    	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1727
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1728
    if ( iCustomBufferHandle )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1729
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1730
	    delete aPicture->iHeader ;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1731
	    aPicture->iHeader = NULL ;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1732
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1733
	else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1734
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1735
		// add to engine if state is not stopped
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1736
		if ( iState->IsStopped() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1737
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1738
			iOutputFreeBufferQueue.Append( aPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1739
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1740
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1741
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1742
			iEngine->AddOutput( aPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1743
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1744
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1745
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1746
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1747
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1748
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1749
//Not supported API.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1750
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1751
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1752
TBool CAriMpeg4aspdecHwDevice::GetSnapshotL( TPictureData& /*aPictureData*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1753
								const TUncompressedVideoFormat& /*aFormat*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1754
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1755
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1756
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1757
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1758
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1759
	return( KErrNone );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1760
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1761
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1762
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1763
//Not supported API.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1764
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1765
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1766
void CAriMpeg4aspdecHwDevice::GetTimedSnapshotL( TPictureData* /*aPictureData*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1767
				const TUncompressedVideoFormat& /*aFormat*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1768
				const TTimeIntervalMicroSeconds& /*aPresentationTimestamp*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1769
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1770
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1771
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1772
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1773
	//Should take it from Post Proc HwDevice
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1774
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1775
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1776
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1777
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1778
//Not supported API.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1779
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1780
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1781
void CAriMpeg4aspdecHwDevice::GetTimedSnapshotL( TPictureData* /*aPictureData*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1782
								const TUncompressedVideoFormat& /*aFormat*/,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1783
								const TPictureId& /*aPictureId*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1784
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1785
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1786
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1787
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1788
	//Should take it from Post Proc HwDevice
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1789
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1790
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1791
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1792
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1793
//Not supported API.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1794
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1795
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1796
void CAriMpeg4aspdecHwDevice::CancelTimedSnapshot()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1797
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1798
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1799
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1800
	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1801
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1802
	return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1803
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1804
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1805
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1806
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1807
//Not supported API.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1808
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1809
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1810
void CAriMpeg4aspdecHwDevice::GetSupportedSnapshotFormatsL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1811
							RArray<TUncompressedVideoFormat>& /*aFormats*/ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1812
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1813
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1814
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1815
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1816
	User::Leave( KErrNotSupported );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1817
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1818
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1819
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1820
//sets the Flag iInputEndCalled to ETrue
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1821
//Notifies the hardware device that the end of input data has been reached
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1822
//and no more input data will be written
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1823
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1824
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1825
void CAriMpeg4aspdecHwDevice::InputEnd()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1826
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1827
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1828
	if ( !( iState->IsTransitionValid( CStateMachine::EInputEndCommand ) ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1829
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1830
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1831
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1832
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1833
	iInputEndCalled = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1834
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1835
	if ( ( iFilledBufferCounter - iInputBufferConsumedCounter ) == 1 )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1836
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1837
		GetLastFrame();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1838
		Stop();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1839
		iMMFDevVideoPlayProxy->MdvppStreamEnd();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1840
		PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1841
        return;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1842
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1843
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1844
	TInt error = iState->Transit( CStateMachine::EInputEndCommand );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1845
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1846
	if ( error != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1847
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1848
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1849
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1850
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1851
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1852
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1853
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1854
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1855
//Notifies the Hw Device that input buffer is free
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1856
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1857
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1858
TInt CAriMpeg4aspdecHwDevice::InputBufferConsumed ( TAny* aInp, TInt aError )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1859
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1860
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1861
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1862
	if ( aInp )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1863
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1864
		 iInputFreeBufferQueue.Append( REINTERPRET_CAST( TVideoInputBuffer*,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1865
														 aInp ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1866
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1867
		 //call back to clinet
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1868
		 if ( ( aError != KErrCancel ) && ( !iInputEndCalled ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1869
			iMMFDevVideoPlayProxy->MdvppNewBuffers();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1870
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1871
	if ( iInputEndCalled && iNoLastOut )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1872
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1873
		HandleInputEndInStopping();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1874
		iMMFDevVideoPlayProxy->MdvppStreamEnd();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1875
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1876
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1877
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1878
	return ( KErrNone );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1879
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1880
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1881
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1882
//Notifies the Hw Device that out buffer has decoded data
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1883
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1884
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1885
TInt CAriMpeg4aspdecHwDevice::OutputBufferReady ( TAny* aOut, TInt aError )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1886
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1887
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1888
    if ( aError == KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1889
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1890
        iPictureNumber++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1891
        // call back information regarding slice and picture loss
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1892
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1893
        SliceAndPictureLoss();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1894
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1895
        //Decoded Buffer is available
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1896
        TVideoPicture* videoPicture = REINTERPRET_CAST( TVideoPicture*,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1897
														aOut );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1898
        
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1899
        videoPicture->iHeader->iPictureNumber = iPictureNumber;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1900
        
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1901
        iFilledBufferCounter--;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1902
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1903
        iPictureCounters.iPicturesDecoded++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1904
        iPictureCounters.iPicturesDisplayed++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1905
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1906
        iDecodingPosition = videoPicture->iTimestamp;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1907
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1908
		if ( !iOutputDevice )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1909
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1910
			iMMFDevVideoPlayProxy->MdvppNewPicture( videoPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1911
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1912
			if ( iInputEndCalled &&
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1913
				 ( ( iFilledBufferCounter - iInputBufferConsumedCounter )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1914
					== 1 )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1915
				)
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1916
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1917
				GetLastFrame();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1918
				Stop();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1919
				PRINT_ERR( "calling streamend\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1920
				iMMFDevVideoPlayProxy->MdvppStreamEnd();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1921
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1922
			PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1923
			return( KErrNone );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1924
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1925
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1926
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1927
			TRAPD( error, iOutputDevice->WritePictureL( videoPicture ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1928
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1929
			if ( error == KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1930
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1931
				if ( iInputEndCalled &&
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1932
					 ( ( iFilledBufferCounter - iInputBufferConsumedCounter )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1933
							 == 1 ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1934
					{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1935
					GetLastFrame();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1936
					HandleInputEndInStopping();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1937
					PRINT_ERR( "calling streamend\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1938
					iMMFDevVideoPlayProxy->MdvppStreamEnd();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1939
					}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1940
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1941
	            else if ( error ) // KErrArgument, KErrNotReady
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1942
	               {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1943
	                iPictureCounters.iPicturesDisplayed--;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1944
	                // Currently not handled
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1945
	               }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1946
            }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1947
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1948
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1949
    else if ( aError == KErrCancel )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1950
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1951
		 // Add buffers to output free buffer queue if cutombuffer is not set
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1952
		if ( !iCustomBufferHandle )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1953
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1954
			iOutputFreeBufferQueue.Append( REINTERPRET_CAST( TVideoPicture*,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1955
																	aOut ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1956
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1957
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1958
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1959
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1960
			delete ( ( TVideoPicture* )aOut )->iHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1961
			( ( TVideoPicture* )aOut )->iHeader = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1962
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1963
			// release the buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1964
			iCustomBufferHandle->MmvbmReleaseBuffer( REINTERPRET_CAST(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1965
												    TVideoPicture*, aOut ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1966
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1967
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1968
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1969
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1970
    else // other errors
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1971
        {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1972
        // currently not handled
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1973
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1974
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1975
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1976
	return ( KErrNone );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1977
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1978
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1979
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1980
//Notifies the hw devcie that Error has occured in PE
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1981
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1982
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1983
void CAriMpeg4aspdecHwDevice::FatalErrorFromProcessEngine ( TInt aError )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1984
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1985
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1986
	PRINT_ERR( "not supported API\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1987
	iMMFDevVideoPlayProxy->MdvppFatalError( this, aError );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1988
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1989
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1990
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1991
//Callback to indicate the command has been processed
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1992
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1993
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1994
void CAriMpeg4aspdecHwDevice::CommandProcessed ( TInt aCmd, TAny* aCmdData,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1995
												TInt aError )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1996
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1997
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1998
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1999
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2000
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2001
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2002
//Call back from output device, indicates buffers availability
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2003
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2004
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2005
void CAriMpeg4aspdecHwDevice::MmvbmoNewBuffers()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2006
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2007
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2008
	TVideoPicture* videoPicture = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2009
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2010
	TRAPD( err, videoPicture = iCustomBufferHandle->MmvbmGetBufferL(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2011
									iCustomBufferOptions->iBufferSize ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2012
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2013
	if ( err != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2014
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2015
		PRINT_ERR( "iCustomBufferHandle->MmvbmGetBufferL returned error\n" );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2016
		iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2017
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2018
	if (  videoPicture )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2019
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2020
		if ( videoPicture->iHeader )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2021
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2022
			delete videoPicture->iHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2023
			videoPicture->iHeader = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2024
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2025
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2026
        TRAPD(  err1, videoPicture->iHeader =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2027
									   new ( ELeave ) TVideoPictureHeader ) ;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2028
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2029
        if ( err1 != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2030
        	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2031
        	iCustomBufferHandle->MmvbmReleaseBuffer( videoPicture ) ;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2032
        	iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrArgument );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2033
        	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2034
        else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2035
        	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2036
		    iEngine->AddOutput( videoPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2037
        	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2038
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2039
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2040
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2041
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2042
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2043
//Callback from output device.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2044
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2045
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2046
void CAriMpeg4aspdecHwDevice::MmvbmoReleaseBuffers()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2047
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2048
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2049
	iEngine->Stop();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2050
	iEngine->Reset();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2051
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2052
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2053
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2054
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2055
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2056
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2057
//Call back from the codec wrapper when there is new config information.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2058
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2059
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2060
void CAriMpeg4aspdecHwDevice::NewConfigFound()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2061
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2062
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2063
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2064
    /* Reset the all the output buffers added to the ProcessEngine.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2065
	 * Create them again if custom buffers are not used.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2066
	 */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2067
	while ( iEngine->NumOutputBuffers() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2068
		  OutputBufferReady ( iEngine->FetchOutputBuffer(), KErrCancel );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2069
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2070
	iOutputBuffersCreated = EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2071
	iBufferAdded          = EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2072
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2073
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2074
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2075
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2076
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2077
//Call back from the codec wrapper when EInputConsumed for Not yet get I frame
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2078
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2079
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2080
void CAriMpeg4aspdecHwDevice::EInputConsumed()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2081
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2082
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2083
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2084
	iInputBufferConsumedCounter++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2085
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2086
	if ( iInputEndCalled && ( iFilledBufferCounter ==
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2087
							  ( iInputBufferConsumedCounter + 1 ) ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2088
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2089
		iNoLastOut = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2090
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2091
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2092
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2093
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2094
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2095
//Set the proxy implementation to be used. Called just
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2096
//after the object is constructed
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2097
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2098
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2099
void CAriMpeg4aspdecHwDevice::SetProxy( MMMFDevVideoPlayProxy& aProxy )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2100
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2101
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2102
	iMMFDevVideoPlayProxy = &aProxy;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2103
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2104
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2105
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2106
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2107
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2108
//Default constructor of CAriMpeg4aspdecHwDevice
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2109
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2110
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2111
CAriMpeg4aspdecHwDevice::CAriMpeg4aspdecHwDevice()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2112
    :iInputFreeBuffers( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2113
     iOutputDevice( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2114
     iMMFDevVideoPlayProxy( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2115
	 iState( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2116
     iVideoPictureHeader( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2117
	 iDecodingPosition( TTimeIntervalMicroSeconds( 0 ) ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2118
     iInputFormat( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2119
     iCodec( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2120
     iEngine( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2121
     iInputEndCalled( EFalse ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2122
     iOutputFreeBuffer( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2123
     iFilledBufferCounter( 0 ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2124
     iDataUnitType( EDuCodedPicture ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2125
     iEncapsulation( EDuElementaryStream ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2126
     iOutputBufferSize( 0 ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2127
     iOutputBuffersCreated( EFalse ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2128
     iPictureNumber( 0 ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2129
     iNumberOfInputBuffersAllocated( 0 ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2130
	 iCustomBufferHandle( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2131
	 iCustomBufferOptions( NULL ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2132
	 iBufferAdded( EFalse ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2133
     iConfigureDecoderCalled( EFalse ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2134
	 iDecoderConfigured( EFalse ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2135
	 iInputBufferConsumedCounter( 0 ),
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2136
	 iNoLastOut( EFalse )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2137
    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2138
    PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2139
	iBufferOptions.iPreDecodeBufferSize 		= 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2140
	iBufferOptions.iMaxPostDecodeBufferSize   	= 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2141
	iBufferOptions.iPreDecoderBufferPeriod 		= 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2142
	iBufferOptions.iPostDecoderBufferPeriod 	= 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2143
	iBufferOptions.iMinNumInputBuffers 			= KMaxInputBuffers;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2144
	iBufferOptions.iMaxInputBufferSize 			= KMaxInputBufferSize;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2145
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2146
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2147
    // Initializing iOutputFormat with one of the combination supported by
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2148
    // Mpeg-4/H.263 hwdevice
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2149
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2150
	iOutputFormat.iDataFormat					= EYuvRawData;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2151
    // For H.263 it is always Bt 601.5 reduced range
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2152
    // For Mpeg-4 input stream contains this information
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2153
	iOutputFormat.iYuvFormat.iCoefficients		= EYuvBt601Range0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2154
    // The input stream format ( H.263 & Mpeg-4 ) comes in Chroma1 format and
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2155
	//so output is also decoded into Chroma1 format
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2156
	iOutputFormat.iYuvFormat.iPattern			= EYuv420Chroma1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2157
	iOutputFormat.iYuvFormat.iDataLayout		= EYuvDataPlanar;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2158
	iOutputFormat.iYuvFormat.iYuv2RgbMatrix		= NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2159
	iOutputFormat.iYuvFormat.iRgb2YuvMatrix		= NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2160
	iOutputFormat.iYuvFormat.iAspectRatioNum	= 1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2161
	iOutputFormat.iYuvFormat.iAspectRatioDenom	= 1;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2162
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2163
    }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2164
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2165
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2166
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2167
//This is the 2nd phase constructor
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2168
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2169
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2170
void CAriMpeg4aspdecHwDevice::ConstructL()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2171
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2172
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2173
	iState = CStateMachine::NewL();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2174
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2175
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2176
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2177
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2178
//Module to create output data
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2179
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2180
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2181
void CAriMpeg4aspdecHwDevice::CreateOutputBuffersL()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2182
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2183
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2184
	if ( iOutputFreeBuffer )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2185
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2186
		for ( TInt i = 0 ; i < KMaxOutputBuffers; i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2187
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2188
			if ( ( iOutputFreeBuffer + i )->iHeader )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2189
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2190
				delete ( iOutputFreeBuffer + i )->iHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2191
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2192
			if ( ( iOutputFreeBuffer + i )->iData.iRawData )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2193
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2194
				delete
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2195
				( TUint8* )( iOutputFreeBuffer + i )->iData.iRawData->Ptr();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2196
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2197
			if ( ( iOutputFreeBuffer + i )->iData.iRawData )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2198
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2199
				delete ( iOutputFreeBuffer + i )->iData.iRawData;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2200
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2201
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2202
		delete [] iOutputFreeBuffer;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2203
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2204
	for ( TInt i = 0; i < iOutputFreeBufferQueue.Count(); i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2205
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2206
		iOutputFreeBufferQueue.Remove( 0 );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2207
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2208
	// Create the output Buffer( s ) and buffers to engine
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2209
	iOutputFreeBuffer = new ( ELeave ) TVideoPicture[KMaxOutputBuffers];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2210
	TInt i;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2211
    for ( i = 0 ; i < KMaxOutputBuffers; i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2212
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2213
        ( iOutputFreeBuffer + i )->iData.iRawData = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2214
		( iOutputFreeBuffer + i )->iHeader = NULL;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2215
        }
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2216
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2217
	for ( i = 0 ; i < KMaxOutputBuffers; i++ )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2218
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2219
		TUint8* ptr;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2220
		TPtr8*  temp;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2221
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2222
		ptr = new ( ELeave ) TUint8[iOutputBufferSize];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2223
		CleanupStack::PushL( ptr );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2224
		temp = new ( ELeave ) TPtr8( ptr, 0, iOutputBufferSize );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2225
		CleanupStack::Pop( ptr );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2226
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2227
		( iOutputFreeBuffer + i )->iData.iRawData = temp;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2228
		( iOutputFreeBuffer + i )->iHeader =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2229
									    new ( ELeave ) TVideoPictureHeader;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2230
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2231
		//Add o/p buffer( s ) to the Queue
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2232
		iEngine->AddOutput( ( iOutputFreeBuffer + i ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2233
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2234
    iBufferAdded = ETrue;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2235
    PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2236
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2237
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2238
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2239
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2240
//Gives callbacks to client regarding slice and picture loss
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2241
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2242
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2243
void CAriMpeg4aspdecHwDevice::SliceAndPictureLoss()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2244
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2245
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2246
	TUint firstMacroblock;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2247
	TUint numMacroblocks;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2248
	TPictureId pictureId;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2249
	pictureId.iIdType = TPictureId::EPictureNumber;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2250
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2251
	// call back to client regading picture loss
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2252
	if ( ( iCodec->GetPictureLossInfo() ) >= KMaxAllowPicLoss )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2253
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2254
	  	PRINT_MSG( LEVEL_LOW, ( "Mpeg4aspdecHwDevice::SliceAndPictureLoss, "
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2255
	  			"				calling callback regading picture loss" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2256
		iMMFDevVideoPlayProxy->MdvppPictureLoss();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2257
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2258
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2259
   	PRINT_MSG( LEVEL_LOW, ( "CAriMpeg4aspdecHwDevice::SliceAndPictureLoss, "
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2260
   			"				calling callback regarding slice loss" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2261
	 // call back to clinet regarding slice loss
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2262
	 iCodec->GetSliceLossInfo( firstMacroblock, numMacroblocks );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2263
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2264
	if ( ( firstMacroblock != 0 ) || ( numMacroblocks != 0 ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2265
	 	iMMFDevVideoPlayProxy->MdvppSliceLoss( firstMacroblock,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2266
											   numMacroblocks,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2267
											   pictureId );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2268
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2269
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2270
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2271
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2272
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2273
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2274
//Creates one input Buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2275
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2276
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2277
void CAriMpeg4aspdecHwDevice::CreateInputBufferL( TUint aBufferSize,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2278
											   TBool aReallocate )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2279
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2280
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2281
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2282
	if ( !aReallocate )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2283
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2284
	   	PRINT_MSG( LEVEL_LOW, ( "CreateInputBufferL 1++" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2285
		// Create the Buffer and add it to Queue
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2286
		TUint8* ptr = new ( ELeave ) TUint8[aBufferSize];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2287
	   	PRINT_MSG( LEVEL_LOW, ( "CreateInputBufferL 2++" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2288
		TInt* lastBufferFlag  = new ( ELeave ) TInt[sizeof( TInt )];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2289
	   	PRINT_MSG( LEVEL_LOW, ( "CreateInputBufferL 3++" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2290
		iInputFreeBuffers[iNumberOfInputBuffersAllocated].iData.Set( ptr,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2291
													0,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2292
													TInt( aBufferSize ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2293
		iInputFreeBuffers[iNumberOfInputBuffersAllocated].iUser =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2294
								   REINTERPRET_CAST( TAny*, lastBufferFlag );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2295
		iInputFreeBufferQueue.Append(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2296
				        iInputFreeBuffers + iNumberOfInputBuffersAllocated );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2297
		iNumberOfInputBuffersAllocated++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2298
	   	PRINT_MSG( LEVEL_LOW, ( "CreateInputBufferL 4++" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2299
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2300
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2301
	else // input buffers are already created and do reallocation here
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2302
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2303
		PRINT_MSG( LEVEL_LOW, ( "CreateInputBufferL 5++" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2304
		TVideoInputBuffer* inBuffer = iInputFreeBufferQueue[0];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2305
		// check the size of the current with the size
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2306
		//of the buffer present in i/p Q
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2307
		if ( aBufferSize > TUint( inBuffer->iData.MaxLength() ) )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2308
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2309
			PRINT_MSG( LEVEL_LOW, ( "CreateInputBufferL 6++" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2310
			// delete the previous buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2311
			delete [] ( TUint8* )inBuffer->iData.Ptr();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2312
			PRINT_MSG( LEVEL_LOW, ( "CreateInputBufferL 7++" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2313
			delete inBuffer->iUser;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2314
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2315
			// reallocate the buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2316
			TUint8* ptr = new ( ELeave ) TUint8[aBufferSize];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2317
			PRINT_MSG( LEVEL_LOW, ( "CreateInputBufferL 8++" ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2318
			//delete inBuffer->iUser;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2319
			TInt* lastBufferFlag  = new ( ELeave ) TInt[sizeof( TInt )];
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2320
			inBuffer->iData.Set( ptr, 0, TInt( aBufferSize ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2321
			inBuffer->iUser = REINTERPRET_CAST( TAny*, lastBufferFlag );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2322
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2323
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2324
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2325
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2326
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2327
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2328
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2329
//When InputEnd is called while the hw device in Stopping State.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2330
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2331
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2332
void CAriMpeg4aspdecHwDevice::HandleInputEndInStopping()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2333
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2334
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2335
	if ( iState->IsInputEndPending() )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2336
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2337
		iPictureNumber = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2338
		// Stop & Reset the Engine
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2339
		iEngine->Stop();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2340
		iBufferAdded			= EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2341
		iFilledBufferCounter	= 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2342
		iInputEndCalled			= EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2343
		iInputBufferConsumedCounter = 0;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2344
		iNoLastOut				= EFalse;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2345
		TInt error = iState->Transit( CStateMachine::EStopCommand );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2346
		if ( error != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2347
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2348
			iMMFDevVideoPlayProxy->MdvppFatalError( this, KErrNotReady );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2349
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2350
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2351
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2352
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2353
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2354
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2355
//Gets the last frame of the sequence.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2356
//---------------------------------------------------------------------------
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2357
//
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2358
void CAriMpeg4aspdecHwDevice::GetLastFrame()
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2359
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2360
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2361
	TInt err = KErrNone;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2362
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2363
	if ( ( iEngine->NumOutputBuffers() ) > 0 )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2364
		{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2365
		TVideoPicture* lVideoPicture =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2366
						( TVideoPicture* )( iEngine->FetchOutputBuffer() );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2367
		err = iCodec->GetLastFrame( lVideoPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2368
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2369
		if ( err == KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2370
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2371
			lVideoPicture->iHeader->iPictureNumber = iPictureNumber;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2372
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2373
			iPictureCounters.iPicturesDecoded++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2374
			iPictureCounters.iPicturesDisplayed++;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2375
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2376
			iDecodingPosition = lVideoPicture->iTimestamp;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2377
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2378
			if ( !iOutputDevice )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2379
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2380
				iMMFDevVideoPlayProxy->MdvppNewPicture( lVideoPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2381
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2382
			else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2383
				{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2384
				TRAPD( error,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2385
					   iOutputDevice->WritePictureL( lVideoPicture ) );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2386
				if ( error != KErrNone )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2387
					{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2388
					iPictureCounters.iPicturesDisplayed--;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2389
					// Currently not handled
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2390
		           	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2391
				}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2392
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2393
		else
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2394
			{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2395
			//Add the output buffer back to ProcessEngine
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2396
			iEngine->AddOutput( lVideoPicture );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2397
			}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2398
		}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2399
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2400
	}
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2401
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2402
const TImplementationProxy ImplementationTable[] =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2403
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2404
    IMPLEMENTATION_PROXY_ENTRY( KUidMp4DecoderHwDeviceImplUid,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2405
								CAriMpeg4aspdecHwDevice::NewL )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2406
	};
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2407
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2408
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2409
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2410
														TInt& aTableCount )
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2411
	{
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2412
	PRINT_ENTRY;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2413
	aTableCount =
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2414
			sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2415
	PRINT_EXIT;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2416
	return ImplementationTable;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2417
	}