{"action":"created","issue":{"url":"https://api.github.com/repos/Ruslan-B/FFmpeg.AutoGen/issues/13","repository_url":"https://api.github.com/repos/Ruslan-B/FFmpeg.AutoGen","labels_url":"https://api.github.com/repos/Ruslan-B/FFmpeg.AutoGen/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/Ruslan-B/FFmpeg.AutoGen/issues/13/comments","events_url":"https://api.github.com/repos/Ruslan-B/FFmpeg.AutoGen/issues/13/events","html_url":"https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/13","id":94593816,"number":13,"title":"Some changes/additions I had to make","user":{"login":"superware","id":6965177,"avatar_url":"https://avatars.githubusercontent.com/u/6965177?v=3","gravatar_id":"","url":"https://api.github.com/users/superware","html_url":"https://github.com/superware","followers_url":"https://api.github.com/users/superware/followers","following_url":"https://api.github.com/users/superware/following{/other_user}","gists_url":"https://api.github.com/users/superware/gists{/gist_id}","starred_url":"https://api.github.com/users/superware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superware/subscriptions","organizations_url":"https://api.github.com/users/superware/orgs","repos_url":"https://api.github.com/users/superware/repos","events_url":"https://api.github.com/users/superware/events{/privacy}","received_events_url":"https://api.github.com/users/superware/received_events","type":"User","site_admin":false},"labels":[{"id":32686984,"url":"https://api.github.com/repos/Ruslan-B/FFmpeg.AutoGen/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2015-07-12T19:43:48Z","updated_at":"2016-11-22T11:03:04Z","closed_at":null,"body":"Great wrapper Ruslan!\n\n```\npublic static unsafe partial class FFmpegInvoke\n{\n    [DllImport(AVUTIL_LIBRARY, EntryPoint = \"av_image_alloc\", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]\n    public static extern int av_image_alloc(byte*[] pointers, int[] linesizes, int w, int h, AVPixelFormat pix_fmt, int align);\n\n    [DllImport(AVUTIL_LIBRARY, EntryPoint = \"av_image_copy\", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]\n    public static extern void av_image_copy(byte*[] pointers, int[] linesizes, byte** src_data, int* src_linesizes, AVPixelFormat pix_fmt, int width, int height);\n}\n```\n\n```\n[UnmanagedFunctionPointer(CallingConvention.Cdecl)]\npublic unsafe delegate int AVIOInterruptCBDelegate(void* opaque);\n\n[UnmanagedFunctionPointer(CallingConvention.Cdecl)]\npublic unsafe delegate void AVLogCBDelegate(void* avcl, int level, string fmt, void* vl);\n```\n"},"comment":{"url":"https://api.github.com/repos/Ruslan-B/FFmpeg.AutoGen/issues/comments/262211588","html_url":"https://github.com/Ruslan-B/FFmpeg.AutoGen/issues/13#issuecomment-262211588","issue_url":"https://api.github.com/repos/Ruslan-B/FFmpeg.AutoGen/issues/13","id":262211588,"user":{"login":"superware","id":6965177,"avatar_url":"https://avatars.githubusercontent.com/u/6965177?v=3","gravatar_id":"","url":"https://api.github.com/users/superware","html_url":"https://github.com/superware","followers_url":"https://api.github.com/users/superware/followers","following_url":"https://api.github.com/users/superware/following{/other_user}","gists_url":"https://api.github.com/users/superware/gists{/gist_id}","starred_url":"https://api.github.com/users/superware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superware/subscriptions","organizations_url":"https://api.github.com/users/superware/orgs","repos_url":"https://api.github.com/users/superware/repos","events_url":"https://api.github.com/users/superware/events{/privacy}","received_events_url":"https://api.github.com/users/superware/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T11:03:04Z","updated_at":"2016-11-22T11:03:04Z","body":"I didn't understand you fully, if you include the following in the generated code:\r\n```\r\n[UnmanagedFunctionPointer(CallingConvention.Cdecl)]\r\npublic unsafe delegate int AVIOInterruptCBDelegate(void* opaque);\r\n```\r\nThen it's easy to set `interrupt_calback` by:\r\n```\r\nvar cb = new ffmpeg.AVIOInterruptCBDelegate(InterruptCB);\r\nuint expTime = FFMPEG_TIMEOUT;\r\nfmt_ctx->interrupt_callback = new AVIOInterruptCB()\r\n{\r\n    callback = Marshal.GetFunctionPointerForDelegate(cb),\r\n    opaque = &expTime\r\n};\r\n```"}}
{"actor":{"display_login":"superware"}}