Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "mdfvideoencodehwdeviceadapter.h"
17 #include <mmf/server/mmfdatabuffer.h>
18 #include <mmf/devvideo/devvideobase.h>
19 #include <mmf/devvideo/devvideopuconfig.h>
20 #include <mmf/server/mmfdatabuffer.h>
22 // Literal descriptor for the encoder's info
23 _LIT8(KEncoderInfoCSInfo, "Coded by Symbian");
24 // Literal descriptor for the encoder's implementation info
25 _LIT8(KEncoderInfoISInfo, "Implemented by Symbian");
26 // Literal descriptor for the video encoder panic
27 _LIT(KDevVideoEncoderPanicCategory, "DevVideoEncoder");
29 // Processing unit's input port index
30 const TInt KEncoderPUInputPortIndex = 0;
31 // Processing unit's output port index
32 const TInt KEncoderPUOutputPortIndex = 0;
33 // Processing unit's major version number
34 const TInt KEncoderPUInfoVersionMaj = 0;
35 // Processing unit's minor version number
36 const TInt KEncoderPUInfoVersionMin = 1;
37 // Processing unit's build version number
38 const TInt KEncoderPUInfoVersionBuild = 1;
40 const TInt KBytesPerPixel = 3;
42 void DevVideoEncoderPanic(TInt aReason)
44 User::Panic(KDevVideoEncoderPanicCategory, aReason);
49 Constructs a new instance of CMdfVideoEncodeHwDeviceAdapter.
50 @return "CMdfVideoEncodeHwDeviceAdapter*"
51 A pointer to the newly constructed HwDevice
53 CMdfVideoEncodeHwDeviceAdapter* CMdfVideoEncodeHwDeviceAdapter::NewL()
55 CMdfVideoEncodeHwDeviceAdapter* self = new(ELeave) CMdfVideoEncodeHwDeviceAdapter;
56 CleanupStack::PushL(self);
58 CleanupStack::Pop(self);
65 CMdfVideoEncodeHwDeviceAdapter::CMdfVideoEncodeHwDeviceAdapter()
70 Safe contructor for CMdfVideoEncodeHwDeviceAdapter.
72 void CMdfVideoEncodeHwDeviceAdapter::ConstructL()
74 // Load the PU Loader plugin
75 iPuLoader = static_cast<CMdfPuLoader*>
76 (REComSession::CreateImplementationL(TUid::Uid(KUidPuLoaderImplementation), iPuLoaderDtorKey));
82 CMdfVideoEncodeHwDeviceAdapter::~CMdfVideoEncodeHwDeviceAdapter()
86 iPuLoader->UnloadProcessingUnit(iEncoderPU);
92 REComSession::DestroyedImplementation(iPuLoaderDtorKey);
94 for (TInt i = 0; i < iOutputVideoFormats.Count(); i++)
96 delete iOutputVideoFormats[i];
99 iEncoderPUOutputPortsArray.Reset();
100 iEncoderPUOutputPortsArray.Close();
102 iEncoderPUInputPortsArray.Reset();
103 iEncoderPUInputPortsArray.Close();
105 iPictureRates.Reset();
106 iPictureRates.Close();
108 iInputVideoFormats.Reset();
109 iInputVideoFormats.Close();
111 iOutputVideoFormats.Reset();
112 iOutputVideoFormats.Close();
114 for (TInt i = 0; i < iDataBuffers.Count(); i++)
116 User::Free((TAny*)iDataBuffers[i].iData.Ptr());
118 iDataBuffers.Reset();
119 iDataBuffers.Close();
122 delete iOutputBuffer;
125 void CMdfVideoEncodeHwDeviceAdapter::LoadProcessingUnitL(const CImplementationInformation& aImplInfo)
127 iPuUid = aImplInfo.ImplementationUid();
129 iEncoderPU = iPuLoader->LoadProcessingUnitL(*this,iPuUid);
130 // store the opaque data associated with this PU so we can extract information about
132 iPuData = CCodecApiVideoOpaqueData::NewL(aImplInfo.OpaqueData());
133 iManufacturer = HBufC::NewL(iPuData->Manufacturer().Length());
134 iManufacturer->Des().Copy(iPuData->Manufacturer());
137 // private method : body of Initialize()
138 void CMdfVideoEncodeHwDeviceAdapter::InitializeL()
142 iProxy->MdvrpInitializeComplete(this, KErrNotFound);
146 // we have to pre-check that the image format is set correctly,
147 // else an attempt to set it into the config will panic.
148 switch(iFormat.iDataFormat)
151 User::Leave(KErrNotReady);
158 User::Leave(KErrNotSupported);
162 // get the encoder input ports
163 User::LeaveIfError(iEncoderPU->GetInputPorts(iEncoderPUInputPortsArray));
165 // set the observer for the encoder input ports
166 for(TInt i = 0; i < iEncoderPUInputPortsArray.Count(); i++)
168 iEncoderPUInputPortsArray[i]->MipSetObserver(*this);
171 // get the encoder output ports
172 User::LeaveIfError(iEncoderPU->GetOutputPorts(iEncoderPUOutputPortsArray));
174 // set the observer for the encoder input ports
175 for(TInt i = 0; i < iEncoderPUOutputPortsArray.Count(); i++)
177 iEncoderPUOutputPortsArray[i]->MopSetObserver(*this);
180 TInt bufSize = iPictureSize.iHeight * iPictureSize.iWidth * KBytesPerPixel;
181 iDataBuffers.Reset();
183 // create the buffer. zero out all fields
184 TVideoOutputBuffer buf;
185 memset(&buf, 0, sizeof(buf));
187 TUint8* bufData = (TUint8*)User::AllocL(bufSize);
188 CleanupStack::PushL(bufData);
190 buf.iData.Set(bufData, bufSize);
191 iDataBuffers.AppendL(buf);
193 CleanupStack::Pop(bufData); // don't destroy - owned by iDataBuffers
195 TDevVideoRecordPuConfig config;
196 config.iFrameSize = iPictureSize;
197 config.iImageFormat = iFormat;
198 config.iFrameRate = iFrameRate;
200 TPuConfigDevVideoRecord puConfig(config);
202 // initialize with config info.
203 iEncoderPU->Configure(puConfig);
205 // create input buffer
206 iInputBuffer = CMMFDescriptorBuffer::NewL(bufSize);
207 iEncoderPUInputPortsArray[KEncoderPUInputPortIndex]->MipUseBuffer(*iInputBuffer);
209 // create output buffer
210 TUint32 outputPortBufferSize =
211 iEncoderPUOutputPortsArray[KEncoderPUOutputPortIndex]->MopBufferSize();
212 iOutputBuffer = CMMFDescriptorBuffer::NewL(outputPortBufferSize);
213 iEncoderPUOutputPortsArray[KEncoderPUOutputPortIndex]->MopUseBuffer(*iOutputBuffer);
215 // initialize the encoder PU
216 iEncoderPU->Initialize();
221 @see CMMFVideoHwDevice
223 TAny* CMdfVideoEncodeHwDeviceAdapter::CustomInterface(TUid aInterface)
225 if (aInterface.iUid == KUidDevVideoHwDeviceAdapterSetup)
227 return static_cast<MDevVideoHwDeviceAdapterSetup*>(this);
233 @see CMMFVideoRecordHwDevice
235 CPreProcessorInfo* CMdfVideoEncodeHwDeviceAdapter::PreProcessorInfoLC()
237 // we have no preprocessor info
242 @see CMMFVideoRecordHwDevice
244 void CMdfVideoEncodeHwDeviceAdapter::SetInputFormatL(const TUncompressedVideoFormat& aFormat, const TSize& aPictureSize)
247 iPictureSize = aPictureSize;
251 @see CMMFVideoRecordHwDevice
253 void CMdfVideoEncodeHwDeviceAdapter::SetSourceCameraL(TInt /* aCameraHandle */, TReal /* aPictureRate */)
255 User::Leave(KErrNotSupported);
259 @see CMMFVideoRecordHwDevice
261 void CMdfVideoEncodeHwDeviceAdapter::SetSourceMemoryL(TReal aMaxPictureRate, TBool /* aConstantPictureRate */, TBool /* aProcessRealtime */)
263 iFrameRate = (TInt)aMaxPictureRate;
267 @see CMMFVideoRecordHwDevice
269 void CMdfVideoEncodeHwDeviceAdapter::Initialize()
271 TRAPD(err, InitializeL());
274 iProxy->MdvrpInitializeComplete(this, err);
279 @see CMMFVideoRecordHwDevice
281 void CMdfVideoEncodeHwDeviceAdapter::WritePictureL(TVideoPicture* aPicture)
283 __ASSERT_ALWAYS(iEncoderPU, DevVideoEncoderPanic(0));
287 User::Leave(KErrArgument);
290 // the picture size MUST be the same as the size the encoder has
291 // been initialized with.
292 if(aPicture->iData.iDataSize != iPictureSize)
294 User::Leave(KErrArgument);
297 // Picture received : increment picture count
298 iPictureCounters.iInputPictures++;
299 iCurrentPicture = aPicture;
300 TDes8& data = iInputBuffer->Data();
301 data.SetLength((*aPicture->iData.iRawData).Length());
302 data.Copy(*aPicture->iData.iRawData);
303 iEncoderPUInputPortsArray[KEncoderPUInputPortIndex]->MipWriteData(*iInputBuffer);
304 iEncoderPUOutputPortsArray[KEncoderPUOutputPortIndex]->MopReadData(*iOutputBuffer);
306 // Picture encoded : increment picture count
307 iPictureCounters.iPicturesProcessed++;
311 @see CMMFVideoRecordHwDevice
313 void CMdfVideoEncodeHwDeviceAdapter::InputEnd()
315 // The client has notified us it has reached the end of the input stream
316 iInputStreamEnd = ETrue;
317 iProxy->MdvrpStreamEnd();
321 @see CMMFVideoRecordHwDevice
323 void CMdfVideoEncodeHwDeviceAdapter::Start()
325 __ASSERT_ALWAYS(iEncoderPU, DevVideoEncoderPanic(0));
326 iEncoderPU->Execute();
330 @see CMMFVideoRecordHwDevice
332 void CMdfVideoEncodeHwDeviceAdapter::Stop()
334 iProxy->MdvrpFatalError(this, KErrNotSupported);
338 @see CMMFVideoRecordHwDevice
340 void CMdfVideoEncodeHwDeviceAdapter::Pause()
342 iProxy->MdvrpFatalError(this, KErrNotSupported);
346 @see CMMFVideoRecordHwDevice
348 void CMdfVideoEncodeHwDeviceAdapter::Resume()
350 iProxy->MdvrpFatalError(this, KErrNotSupported);
354 @see CMMFVideoRecordHwDevice
356 void CMdfVideoEncodeHwDeviceAdapter::Freeze()
358 iProxy->MdvrpFatalError(this, KErrNotSupported);
362 @see CMMFVideoRecordHwDevice
364 void CMdfVideoEncodeHwDeviceAdapter::ReleaseFreeze()
366 iProxy->MdvrpFatalError(this, KErrNotSupported);
370 @see CMMFVideoRecordHwDevice
372 TTimeIntervalMicroSeconds CMdfVideoEncodeHwDeviceAdapter::RecordingPosition()
374 // return picture count times frame rate
375 return iPictureCounters.iPicturesProcessed * (1000000 / iFrameRate);
379 @see CMMFVideoRecordHwDevice
381 void CMdfVideoEncodeHwDeviceAdapter::GetPictureCounters(CMMFDevVideoRecord::TPictureCounters& aCounters)
383 aCounters = iPictureCounters;
387 @see CMMFVideoRecordHwDevice
389 void CMdfVideoEncodeHwDeviceAdapter::GetFrameStabilisationOutput(TRect& aRect)
391 aRect = TRect(iPictureSize);
395 @see CMMFVideoRecordHwDevice
397 TUint CMdfVideoEncodeHwDeviceAdapter::NumComplexityLevels()
399 // separate complexity levels are not available; return 1
404 @see CMMFVideoRecordHwDevice
406 void CMdfVideoEncodeHwDeviceAdapter::SetComplexityLevel(TUint /* aLevel */)
411 @see CMMFVideoEncodeHwDevice
413 CVideoEncoderInfo* CMdfVideoEncodeHwDeviceAdapter::VideoEncoderInfoLC()
415 //if PU is not loaded panic
418 DevVideoEncoderPanic(KErrNotReady);
420 // output formats array
421 iOutputVideoFormats.Reset();
422 CCompressedVideoFormat* videoCV = NULL;
423 videoCV = CCompressedVideoFormat::NewL(iPuData->OutputDataType() , KNullDesC8);
424 CleanupStack::PushL(videoCV);
425 iOutputVideoFormats.AppendL(videoCV);
426 // Note; CCompressedVideo object is destroyed in destructor
427 CleanupStack::Pop(videoCV);
429 // input formats array
430 iInputVideoFormats.Reset();
431 TUncompressedVideoFormat inputFormats[3];
432 inputFormats[0].iDataFormat = ERgbRawData;
433 inputFormats[0].iRgbFormat = ERgb16bit565;
434 iInputVideoFormats.AppendL(inputFormats[0]);
435 inputFormats[1].iDataFormat = ERgbFbsBitmap;
436 inputFormats[1].iRgbFormat = EFbsBitmapColor16M;
437 iInputVideoFormats.AppendL(inputFormats[1]);
438 inputFormats[2].iDataFormat = EYuvRawData;
439 memset(&inputFormats[2].iYuvFormat, 0, sizeof(TYuvFormat));
440 iInputVideoFormats.AppendL(inputFormats[2]);
442 // construct the video Encoder info object
443 CVideoEncoderInfo* vInfo = CVideoEncoderInfo::NewL(
447 TVersion(KEncoderPUInfoVersionMaj, KEncoderPUInfoVersionMin, KEncoderPUInfoVersionBuild),
448 EFalse, // not accelerated
449 EFalse, // does not support direct capture
450 iInputVideoFormats.Array(),
451 iOutputVideoFormats.Array(),
452 iPuData->MaxPictureSize(),
453 EDuCodedPicture, // data unit type(s)
454 EDuElementaryStream, // data encapsulation type
455 1, // num bitrate layers
456 EFalse, // does not support supplemental enhancement info
457 1, // unequal error protection levels not supported
458 KMaxTUint32, // max bitrate supported
459 iPuData->MaxPictureRates().Array(),
460 1, // in-layer scalability not supported
461 0, // no supported picture options
462 EFalse, // picture loss not supported,
463 EFalse, // slice loss not supported,
467 CleanupStack::PushL(vInfo);
472 @see CMMFVideoEncodeHwDevice
474 void CMdfVideoEncodeHwDeviceAdapter::SetOutputFormatL(const CCompressedVideoFormat& /* aFormat */,
475 TVideoDataUnitType /* aDataUnitType */,
476 TVideoDataUnitEncapsulation /* aDataEncapsulation */,
477 TBool /* aSegmentationAllowed */)
479 User::Leave(KErrNotSupported);
483 @see CMMFVideoEncodeHwDevice
485 void CMdfVideoEncodeHwDeviceAdapter::SetOutputRectL(const TRect& /* aRect */)
487 User::Leave(KErrNotSupported);
491 @see CMMFVideoEncodeHwDevice
493 void CMdfVideoEncodeHwDeviceAdapter::SetInputDevice(CMMFVideoPreProcHwDevice* /*aDevice*/)
495 // Function is not supported.
499 @see CMMFVideoEncodeHwDevice
501 void CMdfVideoEncodeHwDeviceAdapter::SetErrorsExpected(TBool /* aBitErrors */, TBool /* aPacketLosses */)
503 // Function is not supported.
507 @see CMMFVideoEncodeHwDevice
509 void CMdfVideoEncodeHwDeviceAdapter::SetMinRandomAccessRate(TReal /* aRate */)
511 // Function is not supported.
515 @see CMMFVideoEncodeHwDevice
517 void CMdfVideoEncodeHwDeviceAdapter::SetNumBitrateLayersL(TUint /* aNumLayers */)
519 User::Leave(KErrNotSupported);
523 @see CMMFVideoEncodeHwDevice
525 void CMdfVideoEncodeHwDeviceAdapter::SetScalabilityLayerTypeL(TUint /* aLayer */, TScalabilityType /* aScalabilityType */)
527 User::Leave(KErrNotSupported);
531 @see CMMFVideoEncodeHwDevice
533 void CMdfVideoEncodeHwDeviceAdapter::SetGlobalReferenceOptions(TUint /* aMaxReferencePictures */, TUint /* aMaxPictureOrderDelay */)
535 // Function is not supported.
539 @see CMMFVideoEncodeHwDevice
541 void CMdfVideoEncodeHwDeviceAdapter::SetLayerReferenceOptions(TUint /* aLayer */, TUint /* aMaxReferencePictures */, TUint /* aMaxPictureOrderDelay */)
543 // Function is not supported.
547 @see CMMFVideoEncodeHwDevice
549 void CMdfVideoEncodeHwDeviceAdapter::SetBufferOptionsL(const TEncoderBufferOptions& /* aOptions */)
551 User::Leave(KErrNotSupported);
555 @see CMMFVideoEncodeHwDevice
557 void CMdfVideoEncodeHwDeviceAdapter::SetCodingStandardSpecificOptionsL(const TDesC8& /* aOptions */)
559 User::Leave(KErrNotSupported);
563 @see CMMFVideoEncodeHwDevice
565 void CMdfVideoEncodeHwDeviceAdapter::SetImplementationSpecificEncoderOptionsL(const TDesC8& /* aOptions */)
567 User::Leave(KErrNotSupported);
571 @see CMMFVideoEncodeHwDevice
573 HBufC8* CMdfVideoEncodeHwDeviceAdapter::CodingStandardSpecificInitOutputLC()
575 User::Leave(KErrNotSupported);
580 @see CMMFVideoEncodeHwDevice
582 HBufC8* CMdfVideoEncodeHwDeviceAdapter::ImplementationSpecificInitOutputLC()
584 User::Leave(KErrNotSupported);
589 @see CMMFVideoEncodeHwDevice
591 void CMdfVideoEncodeHwDeviceAdapter::SetErrorProtectionLevelsL(TUint /* aNumLevels */, TBool /* aSeparateBuffers */)
593 User::Leave(KErrNotSupported);
597 @see CMMFVideoEncodeHwDevice
599 void CMdfVideoEncodeHwDeviceAdapter::SetErrorProtectionLevelL(TUint /* aLevel */, TUint /* aBitrate */, TUint /* aStrength */)
601 User::Leave(KErrNotSupported);
605 @see CMMFVideoEncodeHwDevice
607 void CMdfVideoEncodeHwDeviceAdapter::SetChannelPacketLossRate(TUint /* aLevel */,
608 TReal /* aLossRate */,
609 TTimeIntervalMicroSeconds32 /* aLossBurstLength */)
611 // Function is not supported.
615 @see CMMFVideoEncodeHwDevice
617 void CMdfVideoEncodeHwDeviceAdapter::SetChannelBitErrorRate(TUint /* aLevel */, TReal /* aErrorRate */, TReal /* aStdDeviation */)
619 // Function is not supported.
623 @see CMMFVideoEncodeHwDevice
625 void CMdfVideoEncodeHwDeviceAdapter::SetSegmentTargetSize(TUint /* aLayer */, TUint /* aSizeBytes */, TUint /* aSizeMacroblocks */)
627 // Function is not supported.
631 @see CMMFVideoEncodeHwDevice
633 void CMdfVideoEncodeHwDeviceAdapter::SetRateControlOptions(TUint /* aLayer */, const TRateControlOptions& /* aOptions */)
635 // Function is not supported.
639 @see CMMFVideoEncodeHwDevice
641 void CMdfVideoEncodeHwDeviceAdapter::SetInLayerScalabilityL(TUint /* aLayer */, TUint /* aNumSteps */,
642 TInLayerScalabilityType /* aScalabilityType */,
643 const TArray<TUint>& /* aBitrateShare */,
644 const TArray<TUint>& /* aPictureShare */)
646 User::Leave(KErrNotSupported);
650 @see CMMFVideoEncodeHwDevice
652 void CMdfVideoEncodeHwDeviceAdapter::SetLayerPromotionPointPeriod(TUint /* aLayer */, TUint /* aPeriod */)
654 // Function is not supported.
658 @see CMMFVideoEncodeHwDevice
660 HBufC8* CMdfVideoEncodeHwDeviceAdapter::CodingStandardSpecificSettingsOutputLC()
662 User::Leave(KErrNotSupported);
667 @see CMMFVideoEncodeHwDevice
669 HBufC8* CMdfVideoEncodeHwDeviceAdapter::ImplementationSpecificSettingsOutputLC()
671 User::Leave(KErrNotSupported);
676 @see CMMFVideoEncodeHwDevice
678 void CMdfVideoEncodeHwDeviceAdapter::SendSupplementalInfoL(const TDesC8& /* aData */)
680 User::Leave(KErrNotSupported);
684 @see CMMFVideoEncodeHwDevice
686 void CMdfVideoEncodeHwDeviceAdapter::SendSupplementalInfoL(const TDesC8& /* aData */, const TTimeIntervalMicroSeconds& /* aTimestamp */)
688 User::Leave(KErrNotSupported);
692 @see CMMFVideoEncodeHwDevice
694 void CMdfVideoEncodeHwDeviceAdapter::CancelSupplementalInfo()
696 // Function is not supported.
700 @see CMMFVideoEncodeHwDevice
702 void CMdfVideoEncodeHwDeviceAdapter::GetOutputBufferStatus(TUint& aNumFreeBuffers, TUint& aTotalFreeBytes)
704 // We have one output buffer, which has a max size of one raw frame.
706 aTotalFreeBytes = iDataBuffers[0].iData.Size();
710 @see CMMFVideoEncodeHwDevice
712 void CMdfVideoEncodeHwDeviceAdapter::ReturnBuffer(TVideoOutputBuffer* /*aBuffer*/)
714 // Receive a used output buffer (from DevVideoRecord)
715 // We do nothing - we have one buffer, which is going to be re-used.
719 @see CMMFVideoEncodeHwDevice
721 void CMdfVideoEncodeHwDeviceAdapter::PictureLoss()
723 // Function is not supported.
727 @see CMMFVideoEncodeHwDevice
729 void CMdfVideoEncodeHwDeviceAdapter::PictureLoss(const TArray<TPictureId>& /* aPictures */)
731 // Function is not supported.
735 @see CMMFVideoEncodeHwDevice
737 void CMdfVideoEncodeHwDeviceAdapter::SliceLoss(TUint /* aFirstMacroblock */, TUint /* aNumMacroblocks */, const TPictureId& /* aPicture */)
739 // Function is not supported.
743 @see CMMFVideoEncodeHwDevice
745 void CMdfVideoEncodeHwDeviceAdapter::ReferencePictureSelection(const TDesC8& /* aSelectionData */)
747 // Function is not supported.
751 @see CMMFVideoRecordHwDevice
753 void CMdfVideoEncodeHwDeviceAdapter::CommitL()
755 User::Leave(KErrNotSupported);
759 @see CMMFVideoRecordHwDevice
761 void CMdfVideoEncodeHwDeviceAdapter::Revert()
763 // Function is not supported.
767 @see CMMFVideoEncodeHwDevice
769 void CMdfVideoEncodeHwDeviceAdapter::SetProxy(MMMFDevVideoRecordProxy& aProxy)
775 void CMdfVideoEncodeHwDeviceAdapter::MipoWriteDataComplete(const MMdfInputPort* aInputPort, CMMFBuffer* aBuffer, TInt aErrorCode)
777 if (aErrorCode != KErrNone)
779 iProxy->MdvrpFatalError(this, aErrorCode);
783 if (aInputPort == iEncoderPUInputPortsArray[KEncoderPUInputPortIndex])
785 if (aBuffer->LastBuffer())
791 iProxy->MdvrpReturnPicture(iCurrentPicture);
792 iCurrentPicture = NULL;
798 void CMdfVideoEncodeHwDeviceAdapter::MipoDisconnectTunnelComplete(const MMdfInputPort* /*aInputPort*/, TInt aErrorCode)
800 if (aErrorCode != KErrNone)
802 iProxy->MdvrpFatalError(this, aErrorCode);
806 void CMdfVideoEncodeHwDeviceAdapter::MopoDisconnectTunnelComplete(const MMdfOutputPort* /*aOutputPort*/, TInt aErrorCode)
808 if (aErrorCode != KErrNone)
810 iProxy->MdvrpFatalError(this, aErrorCode);
815 void CMdfVideoEncodeHwDeviceAdapter::MopoReadDataComplete(const MMdfOutputPort* aOutputPort, CMMFBuffer* aBuffer, TInt aErrorCode)
817 if (aErrorCode != KErrNone)
819 iProxy->MdvrpFatalError(this, aErrorCode);
822 if (aOutputPort == iEncoderPUOutputPortsArray[KEncoderPUOutputPortIndex])
824 TVideoOutputBuffer buf;
825 CMMFDataBuffer* dataBuffer = static_cast<CMMFDataBuffer*>(aBuffer);
826 TUint bufSize = dataBuffer->BufferSize();
827 buf.iData.Set(const_cast<TUint8*>((dataBuffer->Data()).Ptr()), dataBuffer->BufferSize());
829 if (aBuffer->LastBuffer())
832 iProxy->MdvrpStreamEnd();
837 if (!iInputStreamEnd)
839 // still expecting more buffers, so let client know
840 iProxy->MdvrpNewBuffer(&buf);
844 dataBuffer->Data().SetLength(0);
845 dataBuffer->SetLastBuffer(ETrue);
846 // Write a zero sized input buffer to the port, with the last buffer flag set
847 iEncoderPUInputPortsArray[KEncoderPUInputPortIndex]->MipWriteData(*iInputBuffer);
854 void CMdfVideoEncodeHwDeviceAdapter::InitializeComplete(const CMdfProcessingUnit* /*aPu*/, TInt aErrorCode)
856 // KB: We have an error code, so use it not fatal error in this case
857 iProxy->MdvrpInitializeComplete(this, aErrorCode);
860 void CMdfVideoEncodeHwDeviceAdapter::ExecuteComplete(const CMdfProcessingUnit* /*aPu*/, TInt aErrorCode)
862 if (aErrorCode != KErrNone)
864 iProxy->MdvrpFatalError(this, aErrorCode);
869 void CMdfVideoEncodeHwDeviceAdapter::MipoRestartTunnelComplete(const MMdfInputPort* /*aInputPort*/, TInt /*aErrorCode*/)
871 // Function is not supported.
874 void CMdfVideoEncodeHwDeviceAdapter::MopoRestartTunnelComplete(const MMdfOutputPort* /*aOutputPort*/, TInt /*aErrorCode*/)
876 // Function is not supported.
880 @see CMMFVideoRecordHwDevice
882 void CMdfVideoEncodeHwDeviceAdapter::SetClockSource(MMMFClockSource* /* aClock */)
884 // Function is not supported.
888 @see CMMFVideoRecordHwDevice
890 void CMdfVideoEncodeHwDeviceAdapter::SetPreProcessTypesL(TUint32 /* aPreProcessTypes */)
892 User::Leave(KErrNotSupported);
896 @see CMMFVideoRecordHwDevice
898 void CMdfVideoEncodeHwDeviceAdapter::SetRgbToYuvOptionsL(TRgbRange /* aRange */, const TYuvFormat& /* aOutputFormat */)
900 User::Leave(KErrNotSupported);
904 @see CMMFVideoRecordHwDevice
906 void CMdfVideoEncodeHwDeviceAdapter::SetYuvToYuvOptionsL(const TYuvFormat& /* aInputFormat */, const TYuvFormat& /* aOutputFormat */)
908 User::Leave(KErrNotSupported);
912 @see CMMFVideoRecordHwDevice
914 void CMdfVideoEncodeHwDeviceAdapter::SetRotateOptionsL(TRotationType /* aRotationType */)
916 User::Leave(KErrNotSupported);
920 @see CMMFVideoRecordHwDevice
922 void CMdfVideoEncodeHwDeviceAdapter::SetScaleOptionsL(const TSize& /* aTargetSize */, TBool /* aAntiAliasFiltering */)
924 User::Leave(KErrNotSupported);
928 @see CMMFVideoRecordHwDevice
930 void CMdfVideoEncodeHwDeviceAdapter::SetInputCropOptionsL(const TRect& /* aRect */)
932 User::Leave(KErrNotSupported);
936 @see CMMFVideoRecordHwDevice
938 void CMdfVideoEncodeHwDeviceAdapter::SetOutputCropOptionsL(const TRect& /* aRect */)
940 User::Leave(KErrNotSupported);
944 @see CMMFVideoRecordHwDevice
946 void CMdfVideoEncodeHwDeviceAdapter::SetOutputPadOptionsL(const TSize& /* aOutputSize */, const TPoint& /* aPicturePos */)
948 User::Leave(KErrNotSupported);
952 @see CMMFVideoRecordHwDevice
954 void CMdfVideoEncodeHwDeviceAdapter::SetColorEnhancementOptionsL(const TColorEnhancementOptions& /* aOptions */)
956 User::Leave(KErrNotSupported);
960 @see CMMFVideoRecordHwDevice
962 void CMdfVideoEncodeHwDeviceAdapter::SetFrameStabilisationOptionsL(const TSize& /* aOutputSize */, TBool /* aFrameStabilisation */)
964 User::Leave(KErrNotSupported);
968 @see CMMFVideoRecordHwDevice
970 void CMdfVideoEncodeHwDeviceAdapter::SetCustomPreProcessOptionsL(const TDesC8& /* aOptions */)
972 User::Leave(KErrNotSupported);