<< lib/video/VideoCodecVerifier.sleela SLeeLa Standard Library Definition. Definition: Defines the SLeeLa standard-library type VideoCodecVerifier used within the video library family. >> #sleela 2.5 material; < Family: video. The verification layer for video codecs — the SLeeLa mirror > < of sleela_video_codec_by_extension (video/codecs/src/sleela_video_codecs.c). > < A GUI or app uses it to answer "which video codec is this file?" and to turn > < a result code into human-readable text before decoding. > < > < Result codes follow the audio codec convention (sleela_codec_result): > < 0 ok, -1 unsupported, -2 invalid, -3 format, -4 io, -5 state(not loaded). > class VideoCodecVerifier { < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- > << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader, or catalog can read and (where appropriate) override this record. Values are faithful to the subject's real origin where publicly known. >> String metaVersion = "1.0.0"; int metaId = 10966; String metaAuthor = "Kiro Agent"; String metaDate = "2026-10-16"; String metaCopyright = "SLeeLa project"; String metaTrademark = "none"; String metaCorporation = "none"; < metaOrigin: National | | International | Galactic > String metaOrigin = "International"; String metaBirthDate = "2026-10-10"; < metaScienceRating: maturity/robustness on a 1..10 scale > int metaScienceRating = 9; < metaNationalSchedule: a real, citable instrument or "none" > String metaNationalSchedule = "none"; String getMetaVersion() { return metaVersion; } void setMetaVersion(String v) { metaVersion = v; } int getMetaId() { return metaId; } void setMetaId(int v) { metaId = v; } String getAuthor() { return metaAuthor; } void setAuthor(String v) { metaAuthor = v; } String getDate() { return metaDate; } void setDate(String v) { metaDate = v; } String getCopyright() { return metaCopyright; } void setCopyright(String v) { metaCopyright = v; } String getTrademark() { return metaTrademark; } void setTrademark(String v) { metaTrademark = v; } String getCorporation() { return metaCorporation; } void setCorporation(String v) { metaCorporation = v; } String getOrigin() { return metaOrigin; } void setOrigin(String v) { metaOrigin = v; } String getBirthDate() { return metaBirthDate; } void setBirthDate(String v) { metaBirthDate = v; } int getScienceRating() { return metaScienceRating; } void setScienceRating(int v) { metaScienceRating = v; } String getNationalSchedule() { return metaNationalSchedule; } void setNationalSchedule(String v) { metaNationalSchedule = v; } < Resolve a video codec id from a file extension, or -1 if unknown. > < Extensions are taken verbatim from the native video registry; note some > < containers (.webm, .mov) are shared and resolve to a representative codec. > int resolveExtension(string ext){ < Raw Video > if(ext == ".yuv" || ext == ".rgb"){ return 0; } < H.264 > if(ext == ".h264" || ext == ".264"){ return 1; } < HEVC > if(ext == ".h265" || ext == ".hevc"){ return 2; } < AV1 > if(ext == ".av1"){ return 3; } < VP8/VP9 (VP9 default) > if(ext == ".ivf"){ return 5; } < WebM video (VP9 default) > if(ext == ".webm"){ return 5; } < MPEG-2 > if(ext == ".mpg" || ext == ".mpeg" || ext == ".m2v"){ return 6; } < Theora > if(ext == ".ogv"){ return 7; } < Motion JPEG > if(ext == ".mjpg" || ext == ".mjpeg"){ return 8; } < FFV1 > if(ext == ".ffv1"){ return 9; } < ProRes (default .mov) > if(ext == ".mov"){ return 10; } < DNxHD/DNxHR > if(ext == ".mxf"){ return 11; } return -1; } int verifyLoadable(int id){ if(id >= 0 && id < 12){ return 0; } return -2; } string resultText(int code){ if(code == 0){ return "ok"; } if(code == -1){ return "unsupported (backend not present)"; } if(code == -2){ return "invalid arguments"; } if(code == -3){ return "input is not this codec's format"; } if(code == -4){ return "I/O or allocation failure"; } if(code == -5){ return "codec not loaded"; } return "unknown"; } boolean ok(int code){ return code == 0; } }