Project

General

Profile

Actions

Support Request #2764

closed

MSF_REFERENCE

Added by hidden almost 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Customer:
AUDI
Department:
EX
Requester's Priority:
Normal
Support Level:
2nd Level
Resolution:
Workaround Available
Product Issue Numbers:
Affected Products:
Platform:
Windows 7 64bit
Topic:
ADTF::SDK
FAQ Links:

Description

Supportanfrage:

Hallo,

Jan möchte Kopiervorgänge sparen und externen Speicher in einem MediaSample referenzieren.
Uns ist bewusst, dass das seine Gefahren birgt, aber wir wollen es dennoch versuchen ;)

Problem ist allerdings, dass wir von außen nicht mitbekommen, wann der Referenz-Counter des MediaSamples auf 0 geht und somit das MediaSample zerstört wird. Das wäre der Zeitpunkt, an dem wir auch den externen Speicher recyclen können.

Idee für einen Workaround:

· Eigene Implementierung eines MediaSamples, welches einen CallBack anbietet. Problem: Neue Klasse müsste in der Runtime erst registriert werden.

Habt ihr eine Alternative zu unserem Workaround?

Lösung:

Auszug aus der ADTF3 Doku:

/**
 * Sample that uses samples buffers that do not copy the data, but only keep a reference to it.
 * Use this with EXTREME care!! Keep these samples in a
 * \ref adtf::ucom::ant::weak_object_ptr in order to be able to check if they no longer exist
 * before you manipulate the data again.
 */

class cReferenceSample: public cSample

Dort gibt es das Beispiel cDemoSampleDataReferenceSource, mit einem weak_object_ptr kann überprüft werden, ob das Sample noch in Verwendung ist.

zu ADTF 2:
Mangels weak_object_ptr in ADTF2 würde man nicht um eine eigene Implementierung eines MediaSamples herumkommen

Workaround: Für speziellen Anwendungsfall hinreichend großen Ringspeicher nutzen, um sicherzustellen, dass überschriebener Speicher nicht mehr genutzt wird.

Actions #1

Updated by hidden almost 6 years ago

  • Status changed from New to Customer Feedback Required
  • Topic set to ADTF::SDK
  • Customer set to AUDI

Hallo Jens,

um welche ADTF Version handelt es sich in diesem Fall?

Gruß,
Michael

Actions #3

Updated by hidden almost 6 years ago

  • Author changed from hidden to hidden
Actions #4

Updated by hidden almost 6 years ago

Hier der Auszug aus der ADTF3 Doku:

/**
 * Sample that uses samples buffers that do not copy the data, but only keep a reference to it.
 * Use this with EXTREME care!! Keep these samples in a
 * \ref adtf::ucom::ant::weak_object_ptr in order to be able to check if they no longer exist
 * before you manipulate the data again.
 */
class cReferenceSample: public cSample

Da gibts auch das Beispiel cDemoSampleDataReferenceSource. Dort sieht man, dass man mit einem weak_object_ptr überprüfen kann, ob das Sample noch in Verwendung ist.

Wenn das nicht reicht hilft wirklich nur eine eigene Implementierung die im Destruktor ein Callback ruft. Eine neue Media Sample Klasse musst man nicht in der Runtime registrieren, so wie in dem Beispiel zu sehen. Das war in ADTF2 Zeiten nur wegen der Serialisierung notwendig, die ist in ADTF3 aber vom Sample losgelöst.

Actions #5

Updated by hidden almost 6 years ago

  • Author changed from hidden to hidden
Actions #6

Updated by hidden almost 6 years ago

Hallo Jens,

sieh dir bitte mal die Antwort von Martin Heimlich an.

Gruß,
Michael

Actions #7

Updated by hidden almost 6 years ago

Hallo,

meine Anfrage bezieht sich auf ADTF2.
Ich nehme mit, dass wir in ADTF3 einen praktikablen Weg haben.
Mangels weak_object_ptr in ADTF2 würde ich aber in ADTF2 nicht um eine eigene Implementierung eines MediaSamples herumkommen, richtig?

Workaround: Für speziellen Anwendungsfall hinreichend großen Ringspeicher nutzen, um sicherzustellen, dass überschriebener Speicher nicht mehr genutzt wird.

MfG Jens

Actions #8

Updated by hidden almost 6 years ago

Ja genau.

Actions #9

Updated by hidden almost 6 years ago

Danke, Ticket kann geschlossen werden.

Actions #10

Updated by hidden almost 6 years ago

  • Description updated (diff)
  • Status changed from Customer Feedback Required to To Be Closed
  • Resolution set to Workaround Available
  • Department set to EX
  • Affected Products ADTF 2.14.2, ADTF 3.3.0 added
  • Platform Windows 7 64bit added
Actions #12

Updated by hidden almost 6 years ago

  • Status changed from To Be Closed to Closed
Actions #13

Updated by hidden over 5 years ago

  • Private changed from Yes to No
Actions #14

Updated by hidden almost 4 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF