{"action":"created","issue":{"url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/1626","repository_url":"https://api.github.com/repos/IntelRealSense/librealsense","labels_url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/1626/labels{/name}","comments_url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/1626/comments","events_url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/1626/events","html_url":"https://github.com/IntelRealSense/librealsense/issues/1626","id":318843477,"number":1626,"title":"How to correctly use C API for processing block?","user":{"login":"Gnimuc","id":7437173,"avatar_url":"https://avatars2.githubusercontent.com/u/7437173?v=4","gravatar_id":"","url":"https://api.github.com/users/Gnimuc","html_url":"https://github.com/Gnimuc","followers_url":"https://api.github.com/users/Gnimuc/followers","following_url":"https://api.github.com/users/Gnimuc/following{/other_user}","gists_url":"https://api.github.com/users/Gnimuc/gists{/gist_id}","starred_url":"https://api.github.com/users/Gnimuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gnimuc/subscriptions","organizations_url":"https://api.github.com/users/Gnimuc/orgs","repos_url":"https://api.github.com/users/Gnimuc/repos","events_url":"https://api.github.com/users/Gnimuc/events{/privacy}","received_events_url":"https://api.github.com/users/Gnimuc/received_events","type":"User","site_admin":false},"labels":[{"id":818930276,"url":"https://api.github.com/repos/IntelRealSense/librealsense/labels/C","name":"C","color":"d1ab4d","default":false},{"id":288064121,"url":"https://api.github.com/repos/IntelRealSense/librealsense/labels/question","name":"question","color":"bfe5bf","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-30T10:16:58Z","updated_at":"2018-04-30T12:41:01Z","closed_at":"2018-04-30T12:41:01Z","author_association":"NONE","body":"| Required Info                         |                                                                |\r\n|---------------------------------|------------------------------------------- |\r\n| Camera Model                       | D400  | \r\n| Firmware Version                   | 05.08.15.00 | \r\n| Operating System & Version |    MacOS  | \r\n| Kernel Version (Linux Only)    |  NA                                         | \r\n| Platform                                 | PC  |\r\n| SDK Version                            |  2.10.2                        | \r\n\r\n### Issue Description\r\nI'm trying to colorize the depth stream via colorizer processing block using C API. Here is an MWE:\r\n```C\r\nrs2_processing_block* colormap = rs2_create_colorizer(&e);\r\ncheck_error(e);\r\nrs2_frame_queue* frame_queue = rs2_create_frame_queue(1, &e);\r\ncheck_error(e);\r\n\r\nrs2_frame* frames = rs2_pipeline_wait_for_frames(pipeline, 5000, &e);\r\ncheck_error(e);\r\nint num_of_frames = rs2_embedded_frames_count(frames, &e);\r\ncheck_error(e);\r\n\r\nint i;\r\nfor (i = 0; i < num_of_frames; ++i)\r\n{\r\n    // The retunred object should be released with rs2_release_frame(...)\r\n    rs2_frame* frame = rs2_extract_frame(frames, i, &e);\r\n    check_error(e);\r\n\r\n    // Check if the given frame can be extended to depth frame interface\r\n    // Accept only depth frames and skip other frames\r\n    if (0 == rs2_is_frame_extendable_to(frame, RS2_EXTENSION_DEPTH_FRAME, &e))\r\n         continue;\r\n\r\n    rs2_start_processing(colormap, (rs2_frame_callback*)frame_queue, &e);  \r\n    check_error(e);\r\n    rs2_frame_add_ref(frame, &e);\r\n    check_error(e);\r\n    rs2_process_frame(colormap, frame, &e); \r\n```\r\nThe code crashed with the error: **Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)**\r\n![error](https://user-images.githubusercontent.com/7437173/39422871-e51afc58-4ca1-11e8-85d7-49c3cdafae80.png)\r\n\r\nDid I use the API correctly?  I have no idea on how to debug this. Any help or hint would be appreciated!"},"comment":{"url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/comments/385386933","html_url":"https://github.com/IntelRealSense/librealsense/issues/1626#issuecomment-385386933","issue_url":"https://api.github.com/repos/IntelRealSense/librealsense/issues/1626","id":385386933,"user":{"login":"Gnimuc","id":7437173,"avatar_url":"https://avatars2.githubusercontent.com/u/7437173?v=4","gravatar_id":"","url":"https://api.github.com/users/Gnimuc","html_url":"https://github.com/Gnimuc","followers_url":"https://api.github.com/users/Gnimuc/followers","following_url":"https://api.github.com/users/Gnimuc/following{/other_user}","gists_url":"https://api.github.com/users/Gnimuc/gists{/gist_id}","starred_url":"https://api.github.com/users/Gnimuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gnimuc/subscriptions","organizations_url":"https://api.github.com/users/Gnimuc/orgs","repos_url":"https://api.github.com/users/Gnimuc/repos","events_url":"https://api.github.com/users/Gnimuc/events{/privacy}","received_events_url":"https://api.github.com/users/Gnimuc/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T12:41:01Z","updated_at":"2018-04-30T12:41:01Z","author_association":"NONE","body":"@dorodnic thanks for your quick reply!!! I changed `rs2_start_processing` to `rs2_start_processing_queue` and everything works like a charm. "}}
{"actor":{"display_login":"Gnimuc"}}