Skip to content

FFMpeg Custom Class (FFCC)

Robert Russell edited this page Jun 18, 2019 · 4 revisions

Constructors

Open File

public Ffcc(string filename, AVMediaType mediatype = AVMediaType.AVMEDIA_TYPE_AUDIO, FfccMode mode = FfccMode.STATE_MACH, int loopstart = -1)

Arguments

  • string filename
  • AVMediaType mediatype
    • Default: AVMediaType.AVMEDIA_TYPE_AUDIO
    • Alt: AVMediaType.AVMEDIA_TYPE_VIDEO
  • FfccMode mode
    • Default: FfccMode.STATE_MACH
      • Means it only processes a part of the file then waits for a request for more. Can be Audio or Video
    • Alt: FfccMode.PROCESS_ALL
      • Means it reads the entire file into memory. Can be used with Audio only.
  • int loopstart
    • Default: -1
      • Sets loop start point for ogg files it is detected automatically. -1 means no loop or autodetect for ogg. Example: 0 means loop from start of sound.

Read From Memory for adpcm audio.

public Ffcc(Buffer_Data buffer_Data, byte[] headerData, string datafilename, int loopstart = -1) Because the bufferdata won't exist after this is ran FfccMode.PROCESS_ALL is forced for this constructor. So the entire sound is processed and the extra bits are disposed of at one time. AVMediaType.AVMEDIA_TYPE_AUDIO is forced because this only works with audio right now.

  • Buffer_Data buffer_Data
    • byte[] data in a struct with other important adpcm sound data.
  • byte[] headerData
    • adpcm Header Data
  • string datafilename
    • Filename of that contains the data. I don't think this is required.
  • int loopstart
    • Default: -1
      • Sets loop start point. -1 means no loop. Example: 0 means loop from start of sound.

PAK file playback TBD

If we were to create code to read videos from PAK files we'd need to add a new constructor. Would require the buffer data to stay live in memory so that we can use FfccMod.STATE_MACH. Because we only grab video a frame at a time.

Clone this wiki locally