Home | History | Annotate | Download | only in mux

Lines Matching refs:mux

10 // Read APIs for mux.
16 #include "src/mux/muxi.h"
35 static WebPMuxError MuxGet(const WebPMux* const mux, CHUNK_INDEX idx,
37 assert(mux != NULL);
41 SWITCH_ID_LIST(IDX_VP8X, mux->vp8x_);
42 SWITCH_ID_LIST(IDX_ICCP, mux->iccp_);
43 SWITCH_ID_LIST(IDX_ANIM, mux->anim_);
44 SWITCH_ID_LIST(IDX_EXIF, mux->exif_);
45 SWITCH_ID_LIST(IDX_XMP, mux->xmp_);
166 // Create a mux object from WebP-RIFF data.
173 WebPMux* mux = NULL;
196 mux = WebPMuxNew();
197 if (mux == NULL) return NULL;
247 // Add this to mux->images_ list.
248 if (MuxImagePush(wpi, &mux->images_) != WEBP_MUX_OK) goto Err;
260 chunk_list = MuxGetChunkListFromId(mux, id); // List to add this chunk.
263 mux->canvas_width_ = GetLE24(data + 12) + 1;
264 mux->canvas_height_ = GetLE24(data + 15) + 1;
276 // Validate mux if complete.
277 if (MuxValidate(mux) != WEBP_MUX_OK) goto Err;
280 return mux; // All OK;
285 WebPMuxDelete(mux);
292 // Validates that the given mux has a single image.
293 static WebPMuxError ValidateForSingleImage(const WebPMux* const mux) {
294 const int num_images = MuxImageCount(mux->images_, WEBP_CHUNK_IMAGE);
295 const int num_frames = MuxImageCount(mux->images_, WEBP_CHUNK_ANMF);
298 // No images in mux.
304 // Frame case OR an invalid mux.
311 static WebPMuxError MuxGetCanvasInfo(const WebPMux* const mux,
316 assert(mux != NULL);
319 if (MuxGet(mux, IDX_VP8X, 1, &data) == WEBP_MUX_OK) {
325 const WebPMuxImage* const wpi = mux->images_;
327 w = mux->canvas_width_;
328 h = mux->canvas_height_;
329 if (w == 0 && h == 0 && ValidateForSingleImage(mux) == WEBP_MUX_OK) {
347 WebPMuxError WebPMuxGetCanvasSize(const WebPMux* mux, int* width, int* height) {
348 if (mux == NULL || width == NULL || height == NULL) {
351 return MuxGetCanvasInfo(mux, width, height, NULL);
354 WebPMuxError WebPMuxGetFeatures(const WebPMux* mux, uint32_t* flags) {
355 if (mux == NULL || flags == NULL) return WEBP_MUX_INVALID_ARGUMENT;
356 return MuxGetCanvasInfo(mux, NULL, NULL, flags);
406 WebPMuxError WebPMuxGetChunk(const WebPMux* mux, const char fourcc[4],
409 if (mux == NULL || fourcc == NULL || chunk_data == NULL) {
416 return MuxGet(mux, idx, 1, chunk_data);
419 ChunkSearchList(mux->unknown_, 1, ChunkGetTagFromFourCC(fourcc));
463 const WebPMux* mux, uint32_t nth, WebPMuxFrameInfo* frame) {
468 if (mux == NULL || frame == NULL) {
473 err = MuxImageGetNth((const WebPMuxImage**)&mux->images_, nth, &wpi);
484 WebPMuxError WebPMuxGetAnimationParams(const WebPMux* mux,
489 if (mux == NULL || params == NULL) return WEBP_MUX_INVALID_ARGUMENT;
491 err = MuxGet(mux, IDX_ANIM, 1, &anim);
522 WebPMuxError WebPMuxNumChunks(const WebPMux* mux,
524 if (mux == NULL || num_elements == NULL) {
529 *num_elements = MuxImageCount(mux->images_, id);
531 WebPChunk* const* chunk_list = MuxGetChunkListFromId(mux, id);