diff include/edl.h @ 8:0c98b46eaf73 v2.0

*: update API to 2.0, big changes all APIs now use pointers to an EDL object. it is up to the user to make sure that the pointer is valid. additionally, many things have been separated into new files to make it easier to digest
author Paper <paper@paper.us.eu.org>
date Sun, 03 Mar 2024 17:56:58 -0500
parents fee08fa622e1
children 0cc2555db371
line wrap: on
line diff
--- a/include/edl.h	Mon Jan 15 06:42:30 2024 -0500
+++ b/include/edl.h	Sun Mar 03 17:56:58 2024 -0500
@@ -12,7 +12,12 @@
 	MEDIATYPE_VIDEO,
 	MEDIATYPE_AUDIO,
 	MEDIATYPE_UNKNOWN
-} MediaType;
+} EDL_media_type_t;
+
+typedef enum {
+	EDL_PARSE_ERROR_SUCCESS = 0,
+	EDL_PARSE_ERROR_OUT_OF_MEMORY
+} EDL_parse_error_t;
 
 typedef struct {
 	int id;
@@ -25,7 +30,7 @@
 	int stretch_method;
 	bool looped;
 	bool on_ruler;
-	MediaType media_type;
+	EDL_media_type_t media_type;
 	char* filename;
 	int stream;
 	double stream_start;
@@ -53,10 +58,10 @@
 	size_t size;
 } EDL;
 
-EDL EDL_parse(const char* text, size_t length);
+EDL_parse_error_t EDL_parse(EDL* edl, const char* text, size_t length);
 int EDL_reallocate(EDL* edl, size_t new_capacity);
-char* EDL_dump(EDL edl);
-void EDL_free(EDL edl);
+char* EDL_dump(const EDL* edl);
+void EDL_free(EDL* edl);
 
 #ifdef __cplusplus
 }