IDeckLinkAncillaryPacket is always blank.

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

y-danno

  • Posts: 2
  • Joined: Tue Jan 21, 2020 6:00 am
  • Real Name: Yuichiro Danno

IDeckLinkAncillaryPacket is always blank.

PostTue Jan 21, 2020 6:15 am

Hey there.

I am trying to extract SCTE-104 packets from the VANC's feed.
My code is below;
It seems to get SCTE-104 packet (I got the message "Got SCTE-104" and the result of IDeckLinkAncillaryPacket->getBytes is success),
but I cannot get any valuable AncillaryPacket Data.
Is there anything wrong ?

Please help.

Code: Select all
HRESULT    DeckLinkDevice::VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket)
{
   AncillaryDataStruct      ancillaryData;

   IDeckLinkVideoFrameAncillaryPackets* frameAncillaryPackets = NULL;
   IDeckLinkAncillaryPacket* ancillaryPacket = NULL;
   HRESULT result = S_OK;
   uint8_t ancillaryPacketData;
   unsigned int* size = 0;
   std::string s = "";
   CString displayMessage = NULL;

   if (videoFrame == NULL)
      return S_OK;

   result = videoFrame->QueryInterface(IID_IDeckLinkVideoFrameAncillaryPackets, (void**)&frameAncillaryPackets);
   if (result != S_OK)
   {
      fprintf(stderr, "Could not get ancillary packet store = %08x\n", result);
      goto bail;
   }

   result = frameAncillaryPackets->GetFirstPacketByID(0x41, 0x7, &ancillaryPacket); // for SCTE-104 packet
   if (result != S_OK) {
      goto bail;
   }
   else {
      MessageBox(NULL, TEXT("Got SCTE-104"), TEXT("title"), MB_OK);
   }
   

   result = ancillaryPacket->GetBytes(bmdAncillaryPacketFormatUInt8, (const void**)&ancillaryPacketData, size);
   if (result != S_OK) {
      MessageBox(NULL, TEXT("Could not get bmdAncillaryPacketFormatUInt8"), TEXT("title"), MB_OK);
      goto bail;
   }
   else {
      // ancillaryPacketData is blank
   }

Offline

Cameron Nichols

Blackmagic Design

  • Posts: 443
  • Joined: Mon Sep 04, 2017 4:05 am

Re: IDeckLinkAncillaryPacket is always blank.

PostWed Jan 22, 2020 12:05 am

Hi Yuichiro,

I believe there is an issue with the output parameter types you are calling IDeckLinkAncillaryPacket::GetBytes() with.

Can you please retry with the following changes:
Code: Select all
uint8_t* ancillaryPacketData;
unsigned int size = 0;
Code: Select all
result = ancillaryPacket->GetBytes(bmdAncillaryPacketFormatUInt8, (const void**)&ancillaryPacketData, &size);
Also check what the value for "size" is being output.

Regards
Cameron
Offline

y-danno

  • Posts: 2
  • Joined: Tue Jan 21, 2020 6:00 am
  • Real Name: Yuichiro Danno

Re: IDeckLinkAncillaryPacket is always blank.

PostWed Jan 22, 2020 5:29 am

Hi Cameron,

I could get the right packet data with the changes you mentioned.
Thank you for your quick reply and your kind help.

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 26 guests