×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:MDFDevVideo Record Symbian API

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Removed protection from "CS001065 - MDFDevVideo Record API")
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Merge KB into wiki)
Line 1: Line 1:
 +
{{Archived|timestamp=20120313064930|user=roy.debjit| }}
 
[[Category:Multimedia]][[Category:Symbian C++]][[Category:S60 3rd Edition FP2]][[Category:Code Examples]][[Category:Multimedia]][[Category:Video]]
 
[[Category:Multimedia]][[Category:Symbian C++]][[Category:S60 3rd Edition FP2]][[Category:Code Examples]][[Category:Multimedia]][[Category:Video]]
__NOTOC__
 
__NOEDITSECTION__
 
{{KBCS}}
 
  
{{ArticleMetaData
+
{{ArticleMetaData <!-- v1.2 -->
|sourcecode=[[Media:DevvideoEx.zip]]
+
|sourcecode= [[Media:DevvideoEx.zip]]
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|devices= <!-- Devices tested against - e.g. ''devices=N95, N8'') -->
 
|devices= <!-- Devices tested against - e.g. ''devices=N95, N8'') -->
 
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|platform=S60 3rd Edition, FP2
+
|platform= S60 3rd Edition, FP2
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
|signing=<!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
|capabilities=<!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
+
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
|keywords=MDFDevVideo Record API
+
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
|id=CS001065
+
|keywords= MDFDevVideo Record API
|creationdate=July 7, 2008
+
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
|author=[[User:Forum Nokia KB]]
+
|translated-by= <!-- [[User:XXXX]] -->
|reviewer=[[User:Forum Nokia KB]]
+
|translated-from-title= <!-- Title only -->
|timestamp=20101124
+
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20080707
 +
|author= [[User:Technical writer 1]]
 +
<!-- The following are not in current metadata -->
 +
|timestamp= 20101124
 +
|reviewer= [[User:Nokia Developer KB]]
 +
|id= CS001065
 
}}
 
}}
 
{{Note|This API is not part of the public SDK. It can be found in the [[SDK API Plug-in]]. }}
 
{{Note|This API is not part of the public SDK. It can be found in the [[SDK API Plug-in]]. }}
{{Archived|timestamp=20120313064930|user=roy.debjit| }}
 
  
 
==Overview==
 
==Overview==
Line 34: Line 41:
 
==Link against==
 
==Link against==
 
<code cpp>
 
<code cpp>
  LIBRARY   devvideo.lib  
+
  LIBRARY devvideo.lib  
 
</code>
 
</code>
  
 
==Source file==
 
==Source file==
  
The <tt>MMMFDevVideoObserver</tt> class defines the observer mixin interface that any client using <tt>CMMFDevVideoRecord</tt> must implement.  
+
The {{Icode|MMMFDevVideoObserver}} class defines the observer mixin interface that any client using {{Icode|CMMFDevVideoRecord}} must implement.  
  
 
<code cpp>
 
<code cpp>

Revision as of 04:19, 14 June 2012

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Code ExampleCompatibility
Platform(s): S60 3rd Edition, FP2
S60 3rd Edition FP2
Article
Keywords: MDFDevVideo Record API
Created: User:Technical writer 1 (07 Jul 2008)
Last edited: hamishwillee (14 Jun 2012)

Note.pngNote: This API is not part of the public SDK. It can be found in the SDK API Plug-in.

Contents

Overview

The Video Encoding and Recording API is also known as the DevVideoRecord API. Multimedia Framework (MMF) plug-ins use this interface to access video encoders and preprocessors in a platform and hardware-independent manner.

Header files

   #include <devvideorecord.h>

Link against

 LIBRARY devvideo.lib

Source file

The MMMFDevVideoObserver class defines the observer mixin interface that any client using CMMFDevVideoRecord must implement.

    //MMMFDevVideoRecordObserver
virtual void MdvroReturnPicture(TVideoPicture* aPicture) = 0;
virtual void MdvroSupplementalInfoSent() = 0;
virtual void MdvroNewBuffers() = 0;
virtual void MdvpoError(TInt aError) = 0;
virtual void MdvroInitializeComplete(TInt aError);
Virtual void MdvroStreamEnd();
 
 
 
//NewL()
delete iDvr;
iDvr = NULL;
iDvr = CMMFDevVideoRecord::NewL(*this);
 
// Find an accelerated encoder if possible, non-accelerated if not
RArray<TUid> encs;
iDvr->FindEncodersL(KMime, 0, encs, EFalse);
TUid enc = TUid::Uid(0);
TBool foundAccel = EFalse;
for ( TInt i = 0; i < encs.Count(); i++ ) {
CVideoEncoderInfo *info = iDvr->VideoEncoderInfoLC(encs[i]);
if ( info->Accelerated() ) {
enc = encs[i];
foundAccel = ETrue;
} else if ( !foundAccel ) {
LFPRINT((_L("Not accelerated, but haven't seen one so far --using this")));
enc = encs[i];
} else {
LFPRINT((_L("Not accelerated and already have one -- skipping")));
}
CleanupStack::PopAndDestroy();
}
 
if ( enc.iUid == 0 ) {
User::Leave(KErrNotSupported);
}
 
// Select encoder
iEnc = iDvr->SelectEncoderL(enc);
 
// Input format
TSize size(176, 144);
TUncompressedVideoFormat fmt;
fmt.iDataFormat = EYuvRawData;
fmt.iYuvFormat.iCoefficients = EYuvBt601Range1;
fmt.iYuvFormat.iPattern = EYuv420Chroma2;
fmt.iYuvFormat.iDataLayout = EYuvDataPlanar;
fmt.iYuvFormat.iYuv2RgbMatrix = NULL;
fmt.iYuvFormat.iRgb2YuvMatrix = NULL;
fmt.iYuvFormat.iAspectRatioNum = 1;
fmt.iYuvFormat.iAspectRatioDenom = 1;
iDvr->SetInputFormatL(iEnc, fmt, size);
 
// Output format
CCompressedVideoFormat *cfmt = CCompressedVideoFormat::NewL(KMime);
CleanupStack::PushL(cfmt);
iDvr->SetOutputFormatL(iEnc, *cfmt, EDuCodedPicture,EDuElementaryStream,
EFalse);
CleanupStack::PopAndDestroy(); //cfmt
 
// Buffer options
TEncoderBufferOptions bopt;
bopt.iMaxPreEncoderBufferPictures = 1;
bopt.iHrdVbvSpec = EHrdVbvNone;
bopt.iHrdVbvParams.Set(NULL, 0);
bopt.iMaxOutputBufferSize = 10240;
bopt.iMaxCodedPictureSize = 10240;
bopt.iMaxCodedSegmentSize = 10240; // ignored in non-segmented mode
bopt.iMinNumOutputBuffers = 2;
iDvr->SetBufferOptionsL(bopt);
 
// Source is memory
iDvr->SetSourceMemoryL(15.0, EFalse, EFalse); // not real-time
 
// Initialize
iDvr->Initialize();
 
 
 
//WRITE PIC
// Generate data
TInt y = iPicNum % 14;
Mem::Fill(iYuv, 176*y*10, 200);
Mem::Fill(iYuv + 176*y*10, 176*144 - 176*y*10, 0);
Mem::Fill(iYuv + 176*144, 176*144/2, 128);
 
// Write picture
iPic.iData.iDataFormat = EYuvRawData;
iPic.iData.iDataSize = TSize(176,144);
iPicDataPtr.Set(iYuv, 176*144*3/2, 176*144*3/2);
iPic.iData.iRawData = &iPicDataPtr;
iPic.iOptions = TVideoPicture::ETimestamp;
iPic.iTimestamp = (1000000 * iPicNum) / 15;
TRAPD(err, iDvr->WritePictureL(&iPic));
if ( err != KErrNone ) {
LFPRINT((_L("WritePictureL failed with %d"), err));
TestComplete(err);
}
iPicNum++;


Example project

This application does very basic MPEG-4 video encoding from a memory source and writes the results to a file. It does just about the least amount of work to get everything up and running, and while the settings may be too basic for a real application, it should be useful for comparison purposes. Once the application is running, you can start adding additional rate control and other settings as needed.

Media:DevvideoEx.zip

67 page views in the last 30 days.