NvV4l2ElementPlane.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. /*
  2. * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of NVIDIA CORPORATION nor the names of its
  13. * contributors may be used to endorse or promote products derived
  14. * from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  20. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  21. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  23. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  24. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  26. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. /**
  29. * @file
  30. * <b>NVIDIA Multimedia API: V4L2 Element Plane</b>
  31. *
  32. * @b Description: This file declares a helper class for operations
  33. * performed on a V4L2 Element plane.
  34. */
  35. /**
  36. * @defgroup l4t_mm_nvv4lelementplane_group NvV4l2ElementPlane Class
  37. * @ingroup l4t_mm_nvelement_group
  38. *
  39. * Helper class for operations performed on a V4L2 element plane.
  40. * This includes getting/setting plane formats, plane buffers,
  41. * and cropping.
  42. * @{
  43. */
  44. #ifndef __NV_V4L2_ELELMENT_PLANE_H__
  45. #define __NV_V4L2_ELELMENT_PLANE_H__
  46. #include <pthread.h>
  47. #include "NvElement.h"
  48. #include "NvLogging.h"
  49. #include "NvBuffer.h"
  50. /**
  51. * Prints a plane-specific message of level LOG_LEVEL_DEBUG.
  52. * Must not be used by applications.
  53. */
  54. #define PLANE_DEBUG_MSG(str) COMP_DEBUG_MSG(plane_name << ":" << str);
  55. /**
  56. * Prints a plane-specific message of level LOG_LEVEL_INFO.
  57. * Must not be used by applications.
  58. */
  59. #define PLANE_INFO_MSG(str) COMP_INFO_MSG(plane_name << ":" << str);
  60. /**
  61. * Prints a plane-specific message of level LOG_LEVEL_WARN.
  62. * Must not be used by applications.
  63. */
  64. #define PLANE_WARN_MSG(str) COMP_WARN_MSG(plane_name << ":" << str);
  65. /**
  66. * Prints a plane-specific message of level LOG_LEVEL_ERROR.
  67. * Must not be used by applications.
  68. */
  69. #define PLANE_ERROR_MSG(str) COMP_ERROR_MSG(plane_name << ":" << str);
  70. /**
  71. * Prints a plane-specific system error message of level LOG_LEVEL_ERROR.
  72. * Must not be used by applications.
  73. */
  74. #define PLANE_SYS_ERROR_MSG(str) COMP_SYS_ERROR_MSG(plane_name << ":" << str);
  75. /**
  76. * @brief Defines a helper class for operations performed on a V4L2 Element plane.
  77. *
  78. * This derived class is modeled on the planes of a V4L2 Element. It provides
  79. * convenient wrapper methods around V4L2 IOCTLs associated with plane
  80. * operations such as <code>VIDIOC_G_FMT/VIDIOC_S_FMT</code>, \c VIDIOC_REQBUFS,
  81. * <code>VIDIOC_STREAMON/VIDIOC_STREAMOFF</code>, etc.
  82. *
  83. * The plane buffer type can be either \c V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE (for
  84. * the output plane) or \c V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE (for the capture
  85. * plane).
  86. *
  87. * The plane has an array of NvBuffer object pointers that is allocated and
  88. * initialized during reqbuf call. These \c NvBuffer objects are similar to the
  89. * \c v4l2_buffer structures that are queued/dequeued.
  90. *
  91. * This class provides another feature useful for multi-threading. On calling
  92. * #startDQThread, it internally spawns a thread that runs infinitely until
  93. * signaled to stop. This thread keeps trying to dequeue a buffer from the
  94. * plane and calls a #dqThreadCallback method specified by the user on
  95. * successful dequeue.
  96. *
  97. */
  98. class NvV4l2ElementPlane
  99. {
  100. public:
  101. /**
  102. * Gets the plane format.
  103. *
  104. * Calls @b VIDIOC_G_FMT \c IOCTL internally.
  105. *
  106. * @param[in,out] format A reference to the \c v4l2_format structure to be filled.
  107. * @return 0 for success, -1 otherwise.
  108. */
  109. int getFormat(struct v4l2_format & format);
  110. /**
  111. * Sets the plane format.
  112. *
  113. * Calls @b VIDIOC_S_FMT \c IOCTL internally.
  114. *
  115. * @param[in] format A reference to the \c v4l2_format structure to be set on the plane.
  116. * @return 0 for success, -1 otherwise.
  117. */
  118. int setFormat(struct v4l2_format & format);
  119. /**
  120. * Maps the NvMMBuffer to NvBuffer for V4L2_MEMORY_DMABUF.
  121. *
  122. * @param[in] v4l2_buf Address of the NvBuffer to which the NvMMBuffer is mapped.
  123. * @param[in] dmabuff_fd Index to the field that holds NvMMBuffer attributes.
  124. * @return 0 for success, -1 otherwise.
  125. */
  126. int mapOutputBuffers(struct v4l2_buffer &v4l2_buf, int dmabuff_fd);
  127. /**
  128. * Unmaps the NvMMBuffer for V4L2_MEMORY_DMABUF.
  129. *
  130. * @param[in] index for the current buffer index.
  131. * @param[in] dmabuff_fd Index to the field that holds NvMMBuffer attributes.
  132. * @return 0 for success, -1 otherwise.
  133. */
  134. int unmapOutputBuffers(int index, int dmabuff_fd);
  135. /**
  136. * Gets the cropping rectangle for the plane.
  137. *
  138. * Calls @b VIDIOC_G_CROP \c IOCTL internally.
  139. *
  140. * @param[in] crop A reference to the \c v4l2_crop structure to be filled.
  141. * @return 0 for success, -1 otherwise.
  142. */
  143. int getCrop(struct v4l2_crop & crop);
  144. /**
  145. * Sets the selection rectangle for the plane.
  146. *
  147. * Calls @b VIDIOC_S_SELECTION IOCTL internally.
  148. *
  149. * @param[in] target Specifies the rectangle selection type.
  150. * @param[in] flags Specifies the flags to control selection adjustments.
  151. * @param[in] rect A reference to the selection rectangle.
  152. * @return 0 for success, -1 otherwise.
  153. */
  154. int setSelection(uint32_t target, uint32_t flags, struct v4l2_rect & rect);
  155. /**
  156. * Requests for buffers on the plane.
  157. *
  158. * Calls \c VIDIOC_REQBUFS IOCTL internally. Creates an array of NvBuffer of
  159. * length equal to the count returned by the IOCTL.
  160. *
  161. * @param[in] mem_type Specifies the type of V4L2 memory to be requested.
  162. * @param[in] num Specifies the number of buffers to request on the plane.
  163. * @return 0 for success, -1 otherwise.
  164. */
  165. int reqbufs(enum v4l2_memory mem_type, uint32_t num);
  166. /**
  167. * Queries the status of the buffer at the index.
  168. *
  169. * @warning This method works only for \c V4L2_MEMORY_MMAP memory.
  170. *
  171. * Calls \c VIDIOC_QUERYBUF IOCTL internally. Populates the \a length and \a
  172. * mem_offset members of all the NvBuffer::NvBufferPlane members of the
  173. * \c %NvBuffer object at index \a buf_index.
  174. *
  175. * @param[in] buf_index Specifies the index of the buffer to query.
  176. * @return 0 for success, -1 otherwise.
  177. */
  178. int queryBuffer(uint32_t buf_index);
  179. /**
  180. * Exports the buffer as DMABUF FD.
  181. *
  182. * @warning This method works only for \c V4L2_MEMORY_MMAP memory.
  183. *
  184. * Calls \c VIDIOC_EXPBUF IOCTL internally. Populates the \a fd member of all
  185. * the \c NvBuffer::NvBufferPlane members of \c NvBuffer object at index \a buf_in.
  186. *
  187. * @param[in] buf_index Specifies the index of the buffer to export.
  188. * @return 0 for success, -1 otherwise.
  189. */
  190. int exportBuffer(uint32_t buf_index);
  191. /**
  192. * Starts or stops streaming on the plane.
  193. *
  194. * Calls \c VIDIOC_STREAMON/VIDIOC_STREAMOFF IOCTLs internally.
  195. *
  196. * @param[in] status Must be TRUE to start the stream, FALSE to stop the stream.
  197. * @return 0 for success, -1 otherwise.
  198. */
  199. int setStreamStatus(bool status);
  200. /**
  201. * Checks whether the plane is streaming.
  202. *
  203. * @returns true if the plane is streaming, false otherwise.
  204. */
  205. bool getStreamStatus();
  206. /**
  207. * Sets streaming parameters.
  208. *
  209. * Calls \c VIDIOC_S_PARM IOCTL internally.
  210. *
  211. * @param[in] parm A reference to the \c v4l2_streamparm structure to be set on the
  212. * plane.
  213. * @return 0 for success, -1 otherwise.
  214. */
  215. int setStreamParms(struct v4l2_streamparm & parm);
  216. /**
  217. * Helper method that encapsulates all the method calls required to
  218. * set up the plane for streaming.
  219. *
  220. * Calls reqbuf internally. Then, for each of the buffers, calls #queryBuffer,
  221. * #exportBuffer and maps the buffer/allocates the buffer memory depending
  222. * on the memory type.
  223. *
  224. * @sa deinitPlane
  225. *
  226. * @param[in] mem_type V4L2 Memory to use on the buffer.
  227. * @param[in] num_buffers Number of buffer to request on the plane.
  228. * @param[in] map boolean value indicating if the buffers should be mapped to
  229. memory (Only for V4L2_MEMORY_MMAP).
  230. * @param[in] allocate boolean valued indicating whether the buffers should be
  231. allocated memory (Only for V4L2_MEMORY_USERPTR).
  232. * @return 0 for success, -1 otherwise.
  233. */
  234. int setupPlane(enum v4l2_memory mem_type, uint32_t num_buffers, bool map, bool allocate);
  235. /**
  236. * Helper method that encapsulates all the method calls required to
  237. * deinitialize the plane for streaming.
  238. *
  239. * For each of the buffers, unmaps/deallocates memory depending on the
  240. * memory type. Then, calls reqbuf with count zero.
  241. *
  242. * @sa setupPlane
  243. */
  244. void deinitPlane();
  245. /**
  246. * Gets the streaming/buffer type of this plane.
  247. *
  248. * @returns Type of the buffer belonging to enum \c v4l2_buf_type.
  249. */
  250. inline enum v4l2_buf_type getBufType()
  251. {
  252. return buf_type;
  253. }
  254. /**
  255. * Gets the \c NvBuffer object at index n.
  256. *
  257. * @returns \c %NvBuffer object at index n, NULL if n >= number of buffers.
  258. */
  259. NvBuffer *getNthBuffer(uint32_t n);
  260. /**
  261. * Dequeues a buffer from the plane.
  262. *
  263. * This is a blocking call. This call returns when a buffer is successfully
  264. * dequeued or timeout is reached. If \a buffer is not NULL, returns the
  265. * \c NvBuffer object at the index returned by the \c VIDIOC_DQBUF IOCTL. If this
  266. * plane shares a buffer with other elements and \a shared_buffer is not
  267. * NULL, returns the shared \c %NvBuffer object in \a shared_buffer.
  268. *
  269. * @param[in] v4l2_buf A reference to the \c v4l2_buffer structure to use for dequeueing.
  270. * @param[out] buffer Returns a pointer to a pointer to the \c %NvBuffer object associated with the dequeued
  271. * buffer. Can be NULL.
  272. * @param[out] shared_buffer Returns a pointer to a pointer to the shared \c %NvBuffer object if the queued
  273. buffer is shared with other elements. Can be NULL.
  274. * @param[in] num_retries Number of times to try dequeuing a buffer before
  275. * a failure is returned. In case of non-blocking
  276. * mode, this is equivalent to the number of
  277. * milliseconds to try to dequeue a buffer.
  278. * @return 0 for success, -1 otherwise.
  279. */
  280. int dqBuffer(struct v4l2_buffer &v4l2_buf, NvBuffer ** buffer,
  281. NvBuffer ** shared_buffer, uint32_t num_retries);
  282. /**
  283. * Queues a buffer on the plane.
  284. *
  285. * This method calls \c VIDIOC_QBUF internally. If this plane is sharing a
  286. * buffer with other elements, the application can pass the pointer to the
  287. * shared NvBuffer object in \a shared_buffer.
  288. *
  289. * @param[in] v4l2_buf A reference to the \c v4l2_buffer structure to use for queueing.
  290. * @param[in] shared_buffer A pointer to the shared \c %NvBuffer object.
  291. * @return 0 for success, -1 otherwise.
  292. */
  293. int qBuffer(struct v4l2_buffer &v4l2_buf, NvBuffer * shared_buffer);
  294. /**
  295. * Gets the number of buffers allocated/requested on the plane.
  296. *
  297. * @returns Number of buffers.
  298. */
  299. inline uint32_t getNumBuffers()
  300. {
  301. return num_buffers;
  302. }
  303. /**
  304. * Gets the number of planes buffers on this plane for the currently
  305. * set format.
  306. *
  307. * @returns Number of planes.
  308. */
  309. inline uint32_t getNumPlanes()
  310. {
  311. return n_planes;
  312. }
  313. /**
  314. * Sets the format of the planes of the buffer that is used with this
  315. * plane.
  316. *
  317. * The buffer plane format must be set before calling reqbuf since
  318. * these are needed by the NvBuffer constructor.
  319. *
  320. * @sa reqbufs
  321. *
  322. * @param[in] n_planes Number of planes in the buffer.
  323. * @param[in] planefmts A pointer to the array of \c NvBufferPlaneFormat that describes the
  324. * format of each of the plane. The array length must be at
  325. * least @a n_planes.
  326. */
  327. void setBufferPlaneFormat(int n_planes, NvBuffer::NvBufferPlaneFormat * planefmts);
  328. /**
  329. * Gets the number of buffers currently queued on the plane.
  330. *
  331. * @returns Number of buffers currently queued on the plane.
  332. */
  333. inline uint32_t getNumQueuedBuffers()
  334. {
  335. return num_queued_buffers;
  336. }
  337. /**
  338. * Gets the total number of buffers dequeued from the plane.
  339. *
  340. * @returns Total number of buffers dequeued from the plane.
  341. */
  342. inline uint32_t getTotalDequeuedBuffers()
  343. {
  344. return total_dequeued_buffers;
  345. }
  346. /**
  347. * Gets the total number of buffers queued on the plane.
  348. *
  349. * @returns Total number of buffers queued on the plane.
  350. */
  351. inline uint32_t getTotalQueuedBuffers()
  352. {
  353. return total_queued_buffers;
  354. }
  355. /**
  356. * Waits until all buffers of the plane are queued.
  357. *
  358. * This is a blocking call that returns when all the buffers are queued
  359. * or timeout is reached.
  360. * @param[in] max_wait_ms Maximum time to wait, in milliseconds.
  361. * @return 0 for success, -1 otherwise.
  362. */
  363. int waitAllBuffersQueued(uint32_t max_wait_ms);
  364. /**
  365. * Waits until all buffers of the plane are dequeued.
  366. *
  367. * This is a blocking call that returns when all the buffers are dequeued
  368. * or timeout is reached.
  369. * @param[in] max_wait_ms Maximum time to wait, in milliseconds
  370. * @return 0 for success, -1 otherwise.
  371. */
  372. int waitAllBuffersDequeued(uint32_t max_wait_ms);
  373. /**
  374. * This is a callback function type method that is called by the DQ Thread when
  375. * it successfully dequeues a buffer from the plane. Applications must implement
  376. * this and set the callback using #setDQThreadCallback.
  377. *
  378. * Setting the stream to off automatically stops this thread.
  379. *
  380. * @sa setDQThreadCallback, #startDQThread
  381. *
  382. * @param v4l2_buf A pointer to the \c v4l2_buffer structure that is used for dequeueing.
  383. * @param buffer A pointer to the NvBuffer object at the \c index contained in \c v4l2_buf.
  384. * @param shared_buffer A pointer to the NvBuffer object if the plane shares a buffer with other elements,
  385. * else NULL.
  386. * @param data A pointer to application specific data that is set with
  387. * #startDQThread.
  388. * @returns If the application implementing this call returns FALSE,
  389. * the DQThread is stopped; else, the DQ Thread continues running.
  390. */
  391. typedef bool(*dqThreadCallback) (struct v4l2_buffer * v4l2_buf,
  392. NvBuffer * buffer, NvBuffer * shared_buffer,
  393. void *data);
  394. /**
  395. * Sets the DQ Thread callback method.
  396. *
  397. * The callback method is called from the DQ Thread once a buffer is
  398. * successfully dequeued.
  399. * @param[in] callback Method to be called upon succesful dequeue.
  400. * @returns TRUE for success, FALSE for failure.
  401. */
  402. bool setDQThreadCallback(dqThreadCallback callback);
  403. /**
  404. * Starts DQ Thread.
  405. *
  406. * This method starts a thread internally. On successful dequeue of a
  407. * buffer from the plane, the #dqThreadCallback method set using
  408. * #setDQThreadCallback is called.
  409. *
  410. * Setting the stream to off automatically stops the thread.
  411. *
  412. * @sa stopDQThread, waitForDQThread
  413. *
  414. * @param[in] data A pointer to the application data. This is provided as an
  415. * argument in the \c dqThreadCallback method.
  416. * @return 0 for success, -1 otherwise.
  417. */
  418. int startDQThread(void *data);
  419. /**
  420. * Force stops the DQ Thread if it is running.
  421. *
  422. * Does not work when the device is opened in blocking mode.
  423. *
  424. * @sa startDQThread, waitForDQThread
  425. *
  426. * @return 0 for success, -1 otherwise.
  427. */
  428. int stopDQThread();
  429. /**
  430. * Waits for the DQ Thread to stop.
  431. *
  432. * This method waits until the DQ Thread stops or timeout is reached.
  433. *
  434. * @sa startDQThread, stopDQThread
  435. *
  436. * @param[in] max_wait_ms Maximum wait time, in milliseconds.
  437. * @return 0 for success, -1 otherwise.
  438. */
  439. int waitForDQThread(uint32_t max_wait_ms);
  440. pthread_mutex_t plane_lock; /**< Mutex lock used along with #plane_cond. */
  441. pthread_cond_t plane_cond; /**< Plane condition that application can wait on
  442. to receive notifications from
  443. #qBuffer/#dqBuffer. */
  444. private:
  445. int &fd; /**< A reference to the FD of the V4l2 Element the plane is associated with. */
  446. const char *plane_name; /**< A pointer to the name of the plane. Could be "Output Plane" or
  447. "Capture Plane". Used only for debug logs. */
  448. enum v4l2_buf_type buf_type; /**< Speciifes the type of the stream. */
  449. bool blocking; /**< Specifies whether the V4l2 element is opened with
  450. blocking mode. */
  451. uint32_t num_buffers; /**< Holds the number of buffers returned by \c VIDIOC_REQBUFS
  452. IOCTL. */
  453. NvBuffer **buffers; /**< A pointer to an array of NvBuffer object pointers. This array is
  454. allocated and initialized in #reqbufs. */
  455. uint8_t n_planes; /**< Specifies the number of planes in the buffers. */
  456. NvBuffer::NvBufferPlaneFormat planefmts[MAX_PLANES];
  457. /**< Format of the buffer planes. This must be
  458. initialized before calling #reqbufs since this
  459. is required by the \c %NvBuffer constructor. */
  460. enum v4l2_memory memory_type; /**< Specifies the V4l2 memory type of the buffers. */
  461. uint32_t num_queued_buffers; /**< Holds the number of buffers currently queued on the
  462. plane. */
  463. uint32_t total_queued_buffers; /**< Holds the total number of buffers queued on the
  464. plane. */
  465. uint32_t total_dequeued_buffers; /**< Holds the total number of buffers dequeued from
  466. the plane. */
  467. bool streamon; /**< Specifies whether the plane is streaming. */
  468. bool dqthread_running; /**< Specifies whether DQ Thread is running.
  469. Its value is toggled by the DQ Thread. */
  470. bool stop_dqthread; /**< Specifies the value used to signal the DQ Thread to stop. */
  471. pthread_t dq_thread; /**< Speciifes the pthread ID of the DQ Thread. */
  472. dqThreadCallback callback; /**< Specifies the callback method used by the DQ Thread. */
  473. void *dqThread_data; /**< Application supplied pointer provided as an
  474. argument in #dqThreadCallback. */
  475. /**
  476. * The DQ thread method.
  477. *
  478. * This method runs indefinitely until it is signaled to stop
  479. * by #stopDQThread or the #dqThreadCallback method returns FALSE.
  480. * It keeps on trying to dequeue a buffer from the plane and calls the
  481. * #dqThreadCallback method on successful dequeue.
  482. *
  483. * @param[in] v4l2_element_plane A pointer to the NvV4l2ElementPlane object
  484. * for which the thread started.
  485. */
  486. static void *dqThread(void *v4l2_element_plane);
  487. NvElementProfiler &v4l2elem_profiler; /**< A reference to the profiler belonging
  488. to the plane's parent element. */
  489. /**
  490. * Indicates whether the plane encountered an error during its operation.
  491. *
  492. * @return 0 if no error was encountered, a non-zero value if an
  493. * error was encountered.
  494. */
  495. inline int isInError()
  496. {
  497. return is_in_error;
  498. }
  499. /**
  500. * Creates a new V4l2Element plane.
  501. *
  502. *
  503. * @param[in] buf_type Type of the stream.
  504. * @param[in] device_name A pointer to the name of the element the plane belongs to.
  505. * @param[in] fd A reference to the FD of the device opened using v4l2_open.
  506. * @param[in] blocking A flag that indicates whether the device has been opened with blocking mode.
  507. * @param[in] profiler The profiler.
  508. */
  509. NvV4l2ElementPlane(enum v4l2_buf_type buf_type, const char *device_name,
  510. int &fd, bool blocking, NvElementProfiler &profiler);
  511. /**
  512. * Disallows copy constructor.
  513. */
  514. NvV4l2ElementPlane(const NvV4l2ElementPlane& that);
  515. /**
  516. * Disallows assignment.
  517. */
  518. void operator=(NvV4l2ElementPlane const&);
  519. /**
  520. * NvV4l2ElementPlane destructor.
  521. *
  522. * Calls #deinitPlane internally.
  523. */
  524. ~NvV4l2ElementPlane();
  525. int is_in_error; /**< Indicates if an error was encountered during
  526. the operation of the element. */
  527. const char *comp_name; /**< Specifies the name of the component,
  528. for debugging. */
  529. friend class NvV4l2Element;
  530. };
  531. /** @} */
  532. #endif