LogoLogo
HomeMPEG-5 LCEVCSMPTE VC-6V-Nova PresenZV-Nova Platform
MPEG-5 LCEVC
MPEG-5 LCEVC
  • V-NOVA LCEVC
    • Overview
    • LCEVC Best Practices
  • Encoder
    • Getting Started
    • SDK
      • Encoder Integration Layer (EIL)
        • EIL Integration Process
          • Error Handling
          • Base Encoder Plugin
        • Features
        • Encoding Configuration Properties
        • CBR vs CRF
        • Lower Resolutions (720p and below)
        • V-Nova LCEVC-specific Parameters
        • Metadata
        • API (version 3.9)
    • NDK
      • LCEVC Encoder IP Core
  • Decoder
    • Getting Started
    • SDK
      • LCEVC Decoder for Web (LCEVCdecJS)
      • Decoder Integration Layer (DIL)
        • Functionality
        • API Overview
        • Example Integration Code
        • DIL API
        • DIL Types and Enumerations
        • DIL Properties API
    • NDK
      • LCEVC Decoder IP Core
        • LCEVC Decoder IP Core Deliverables
      • LCEVC Hybrid Driver-level Decoder
  • Integrations
    • LCEVC in Chromium
    • LCEVC in WebRTC
    • FFmpeg with LCEVC
      • Example Script
      • FFmpeg Encoder
      • FFmpeg Decoder
      • Putting the Software Together
    • Player Integrations
      • AVPlayer with LCEVC
      • VLCKit with LCEVC
      • Shaka Player with LCEVC
      • Embedding LCEVC-enabled demo hls.js player
      • AndroidX (ExoPlayer) with LCEVC
    • LCEVC in Android Open-Source Project
Powered by GitBook
LogoLogo

© Copyright V-Nova 2025

On this page

Was this helpful?

  1. Decoder
  2. SDK
  3. Decoder Integration Layer (DIL)

Example Integration Code

In basic terms, a sample integration code using the DIL can be briefly described, among the various phases, as follows:

// Include DIL header
#include <lcevc_dil.h>
// Initialisation phase ///////////////////////////////////////////////////////
// Create an instance of the DIL
DIL_ContextSettings context_settings = { 0 };
char * json_settings = "{\
 \"gl_decode\": true,\
 \"gl_es\": true,\
 \"gl_major\": 3,\
 \"gl_minor\": 1,\
 \"swap_interval\": 0,\
 \"fullscreen\": false,\
 \"hardware_buffers\": false,\
 \"use_u8_surface\": false,\
 \"force_passthrough\": false\
}";
// Create a DIL instance
DIL_Decoder decoder = nullptr;
if (DIL_Create(json_settings, &context_settings , &decoder) != DIL_RC_Success)
{
    fprintf(stderr, "Unable to create DIL instance\n");
    exit(-1);
}
// Destruction phase //////////////////////////////////////////////////////////
DIL_Destroy(decoder);
decoder = nullptr;
// Handling input buffers /////////////////////////////////////////////////////
//...
DIL_NALFormat nalFormat;
// Set NAL format, from metadata, properties or parsing the input buffers
// ...
if (DIL_AddNALData(decoder, inputCc, presentationTimeStamp, buffer, length, nalFormat) != DIL_RC_Success)
{
    fprintf(stderr, "Unable to pass input buffer for inputCc=%u pts=%PRId64\n", inputCc, presentationTimeStamp);
    exit(-2);
}
// Handling decoded frame from base decoder ///////////////////////////////////
// ...
// Get size of ouput picture if needed
DIL_DecodeInformation decodeInfo;
if (DIL_GetDecodeInformation(decoder, inputCc, presentationTimeStamp, baseWidth, baseHeight, &decodeInfo) != DIL_RC_Success)
{
    fprintf(stderr, "DIL get decode info failed for inputCc=%u pts=%PRId64\n", inputCc, baseImage.pts;
    exit(-3);
}
// Using decode info
// ...
DIL_Image baseImage;
// Fill the base "Image" struct with the data properties of the base frame
// ...
DIL_RenderInformation renderInfo;
// Fill rotation and pixel aspect ratio
// ...
if (DIL_DecodeAndRender(decoder, inputCc, presentationTimeStamp, baseImage, &renderInfo, &decodeInfo) != DIL_RC_Success)
{
    fprintf(stderr, "DIL decode failed for pts=%PRId64\n", baseImage.pts;
    exit(-4);
}
// Decode info reports if LCEVC is available and has been applied
// ...
PreviousAPI OverviewNextDIL API

Last updated 4 months ago

Was this helpful?