CN104918112B - The application process and device of camera resource - Google Patents

The application process and device of camera resource Download PDF

Info

Publication number
CN104918112B
CN104918112B CN201410092530.3A CN201410092530A CN104918112B CN 104918112 B CN104918112 B CN 104918112B CN 201410092530 A CN201410092530 A CN 201410092530A CN 104918112 B CN104918112 B CN 104918112B
Authority
CN
China
Prior art keywords
application
camera resource
virtual camera
resource
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410092530.3A
Other languages
Chinese (zh)
Other versions
CN104918112A (en
Inventor
璧垫尝
赵波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201410092530.3A priority Critical patent/CN104918112B/en
Publication of CN104918112A publication Critical patent/CN104918112A/en
Application granted granted Critical
Publication of CN104918112B publication Critical patent/CN104918112B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Telephonic Communication Services (AREA)
  • Studio Devices (AREA)

Abstract

The invention discloses a kind of application process of camera resource, comprise the following steps:When receiving the application request of the first application, the application number of currently used camera resource is obtained according to the application request;When it is described application number for it is at least one when, by the first virtual camera resource allocation being pre-created to described first using;Second virtual camera resource is created according to the described first application;Described first using the first virtual camera resource during receive the application request of the second application when, by the second virtual camera resource allocation to described second using, the invention also discloses a kind of application apparatus of camera resource, the present invention can simplify camera more using when operating process, realize that more applications use camera resource simultaneously.

Description

The application process and device of camera resource
Technical field
The present invention relates to intelligence system technical field, more particularly to a kind of application process and device of camera resource.
Background technology
With the popularization and application of shooting electronic product, people are to the frequency of use more and more higher of camera, in particular with intelligence The development with rapid changepl. never-ending changes and improvements of energy mobile terminal technology and the network communications technology, it is combined with camera produces many new applications, people Be no longer satisfied with only carrying out this original function of taking a picture using only camera, camera leads to intelligent mobile terminal and network Letter technology is combined, and new application is produced in social, monitoring, interaction etc. etc..
By taking current intelligent television as an example, included in intelligent television using the application of camera:This ground camera, face are known Not, gesture identification, network album, jump, love sight and it is aroused in interest feel etc., numerous applications is required for using camera work( Energy.An intelligent television typically only camera resource, it is now multiple to conflict using that cause during camera or at all can not Multiple applications are used simultaneously, and traditional solution method is using camera resource by defining series of rules, such as using 1 Shi Yingyong 2 is also required to use camera, then must send out message using 2 and inform intelligent television, intelligent television notice is using 1 release phase Machine resource, camera resource is obtained again using 2 and is used, whole process is cumbersome, and interaction logic is cumbersome, it is impossible to accomplishes simultaneously Multiple applications use camera resource simultaneously, can not meet requirement instantly.
The above is only used for auxiliary and understands technical scheme, does not represent and recognizes that the above is existing skill Art.
The content of the invention
It is a primary object of the present invention to provide a kind of application process and device of camera resource, it is intended to simplify camera more Using when operating process, realize that more applications use camera resource simultaneously.
To achieve the above object, the application process of a kind of camera resource provided by the invention, comprises the following steps:
When receiving the application request of the first application, answering for currently used camera resource is obtained according to the application request Use number;
When the application number is at least one, described first is given by the first virtual camera resource allocation being pre-created Using;
Second virtual camera resource is created according to the described first application;
Described first using the first virtual camera resource during receive the application request of the second application when, By the second virtual camera resource allocation to described second using.
Preferably, it is described when receiving the application request of the first application, obtained according to the application request currently used The step of application number of camera resource, includes:
Pre-set a global variable NUM;
After camera initialization, the initial value for putting the global variable NUM is 0, and by the global variable NUM's Initial value follows the number of the application request received and is incremented by;
When receiving the application request of the first application, it is currently used that the camera is obtained according to the global variable NUM The application number of camera resource.
Preferably, described the step of creating the second virtual camera resource according to the described first application, includes:
A dummy node is created, and memory space is distributed for the dummy node;
Obtain described first apply receive it is described second application application request after use during video Data, and replicate the video data;
Video data after duplication is stored into memory space corresponding to the dummy node, generation described second is virtual Camera resource.
Preferably, in addition to:When receiving the cancellation request for cancelling the first application or the second application, described first is deleted Using the second virtual camera resource corresponding to corresponding first virtual camera resource or the second application.
The present invention also provides a kind of application apparatus of camera resource, including:
Acquisition module, for when receiving the application request of the first application, being obtained according to the application request currently to make With the application number of camera resource;
First distribute module, for the first virtual camera that when the application number is at least one, will be pre-created Resource allocation to described first using;
Creation module, for creating the second virtual camera resource according to the described first application;
Second distribute module, for described first using the first virtual camera resource during receive second During the application request of application, by the second virtual camera resource allocation to described second using.
Preferably, the acquisition module includes:
Setting unit, for pre-setting a global variable NUM;
Processing unit, the initial value for after camera initialization, putting the global variable NUM is 0, and by described in Global variable NUM initial value follows the number of the application request received and is incremented by;
Acquiring unit, for when receiving the application request of the first application, according to being obtained the global variable NUM The application number of the currently used camera resource of camera.
Preferably, the creation module includes:
Creating unit, for creating a dummy node according to the described first application, and it is dummy node distribution storage Space;
Copied cells, the use process after the application request of second application is received is applied for acquisition first In video data, and replicate the video data;
Generation unit, it is raw for the video data after duplication to be stored into memory space corresponding to the dummy node Into the second virtual camera resource.
Preferably, in addition to removing module, for when receiving the cancellation request for cancelling the first application or the second application, Delete the first virtual camera resource corresponding to first application or the corresponding second virtual camera money of the second application.
The application process and device of a kind of camera resource provided by the invention, the application number current to camera are sentenced It is fixed, if having had one or more using the first virtual camera that when using camera resource at the same time, will can be pre-created Resource allocation uses to the application of current request, while creates the second virtual camera resource, by the second virtual camera resource point Dispensing subsequent applications use, due to that can complete all work(of camera using virtual camera resource and using physics camera resource Can, video flowing or photo are such as obtained, therefore more applications can be realized while use camera resource;In addition, the present invention more should When using camera resource with request, directly virtual camera resource can be distributed according to application request, it is not necessary to which application is carried out with equipment Cumbersome interaction, realize that logic is simpler, simplify operating process.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the application process first embodiment of camera resource of the present invention;
Fig. 2 is that step S101 shown in Fig. 1 refines schematic flow sheet;
Fig. 3 is that step S103 shown in Fig. 1 refines schematic flow sheet;
Fig. 4 is the schematic flow sheet of the application process second embodiment of camera resource of the present invention;
Fig. 5 is the structural representation of the application apparatus first embodiment of camera resource of the present invention;
Fig. 6 is the structural representation of acquisition module shown in Fig. 5;
Fig. 7 is the structural representation of creation module shown in Fig. 5;
Fig. 8 is the structural representation of the application apparatus second embodiment of camera resource of the present invention.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of application process of camera resource, and reference picture 1, in one embodiment, this method includes:
Step S101, when receiving the application request of the first application, currently used phase is obtained according to the application request The application number of machine resource;
In the present embodiment, camera can be embedded intelligent terminal either in the equipment such as intelligent television or computer, and answer With program installation in the apparatus.By taking intelligent television as an example, its application is taken pictures including the use of this ground camera and video is chatted My god, using camera carry out recognition of face or gesture identification to be remotely controlled operation, using network album function of camera etc..
Wherein, the camera resource in the present embodiment includes physics camera resource and virtual camera resource.Physics camera resource The software resource being related in the course of the work including hardware resource and camera, hardware resource include camera lens, imaging sensor, synchronization Signal generator, CCD drivers, picture signal form circuit, power circuit etc.;Software resource includes image processing program, figure As condensing routine and other call above-mentioned hardware resources and interface program etc..Virtual camera resource in physics camera resource Through being created in the case of use, basis is provided using camera simultaneously for more applications so that multiple applications can use phase simultaneously Machine, it for details, reference can be made to the relevant portion in following embodiments.
Step S102, when the application number for it is at least one when, the first virtual camera resource allocation that will be pre-created To described first using.
Wherein, when application number is at least one, that is, there is one or more to apply and using camera resource, now, can With the first virtual camera resource allocation that will be pre-created to first using.
The first virtual camera resource and physics camera resource in the present embodiment is similar in form, and can complete phase All functions of machine, such as obtain video flowing or photo.Physics camera resource is the camera resource of equipment acquiescence, and it is being applied When, it is always supplied to first application for sending request and is used, that is, is supplied to upper one of the first application to send answering for request With being used.It is virtual by first upon receipt during the application request of the first continuous application after physics camera resource is by use Camera resource allocation to first using.For first virtual camera resource when creating, previous according to the described first application should With establishment, for example, the previous application of the first application is uses camera to carry out Video chat, during Video chat, camera Video flowing constantly is obtained as the data of the application and is stored in a space, while the data duplication portion is stored in another In space, as the first virtual camera resource, it can be seen that store obtained by camera and identical number in two spaces According to.In the application request of the subsequently received first application, such as the first application is gesture identification, then the first application can just make With the first virtual camera resource, i.e., video flowing or photo are obtained in the video flowing stored from another space, and further carry Gesture is taken, other functions of enabling in equipment carry out gesture identification.
In the present embodiment when creating the first virtual camera resource, it is also necessary to create the memory space of correlation, and pass through phase The interface of pass is coordinated, and multiple applications is carried out simultaneously.
Step S103, the second virtual camera resource is created according to the described first application;
Wherein, the second virtual camera resource creates, the establishment of the second virtual camera resource when creating according to the first application It is essentially identical with the establishment of the first virtual camera resource, the relevant portion of above-mentioned steps 102 is specifically referred to, here is omitted.
Step S104, described first using the first virtual camera resource during receive the second application should With request when, will the second virtual camera resource allocation give described second using.
In the present embodiment, in the first virtual camera resource allocation that will be pre-created to first using rear, according to the One application creates the second virtual camera resource, while caused data in the first application are controlled, so as to the second of establishment Virtual camera resource can use caused data in the first application.Same reason, by the second virtual camera resource allocation To second using rear, the 3rd virtual camera resource is created according to the second application, while to caused data in the second application It is controlled, can uses caused data in the second application so as to the 3rd virtual camera resource of establishment, can be multiple thus It is basic using being provided using camera resource simultaneously.What deserves to be explained is in the present embodiment, after physics camera resource is by use, Upon receipt during the application request of the first continuous application, by the first virtual camera resource allocation to first using in thing Camera resource and the first virtual camera resource are managed by after use, upon receipt during the application request of the second continuous application, by the Two virtual camera resource allocations to second using, the like.
In addition, when receiving the application request of the second application or follow-up application request, need also exist for obtaining use The current application number of camera resource, that is, obtain global variable NUM value, and adds 1 to perform follow-up behaviour again NUM value Make.
The present embodiment the first virtual camera resource by use, according to previous application create virtual camera resource, So that follow-up application uses, when follow-up application also asks to use camera resource, will directly can create Virtual camera resource allocation uses to current application, without re-creating, improves the speed of camera resource allocation, convenient to use The use at family.
Compared with prior art, the present embodiment application number current to camera judges, if had one or , can be by the first virtual camera resource allocation being pre-created to current request when multiple applications use camera resource at the same time Using using, while the second virtual camera resource is created, give subsequent applications to use the second virtual camera resource allocation, due to Using virtual camera resource with all functions of camera can be completed using physics camera resource, video flowing or photograph are such as obtained Piece etc., therefore more applications can be realized while use camera resource;In addition, the present embodiment uses camera resource in more application requests When, can directly according to application request distribute virtual camera resource, it is not necessary to application with equipment carry out it is cumbersome interact, realize logic It is relatively simple, simplify operating process.
In a preferred embodiment, as shown in Fig. 2 on the basis of Fig. 1 embodiment, above-mentioned steps S101, which works as, to be received During the application request of the first application, wrapped according to the step of application number of the currently used camera resource of application request acquisition Include:
Step S1011, pre-set a global variable NUM;
Step S1012, after camera initialization, the initial value for putting the global variable NUM is 0, and will be described complete Office variable NUM initial value follows the number of the application request received and is incremented by;
Step S1013, when receiving the application request of the first application, being obtained according to the global variable NUM currently makes With the application number of camera resource.
Wherein, the current application number of camera is obtained concretely:A global variable NUM can be pre-set, at the beginning of camera The initialization to camera and its memory space, and global variable NUM initialization, i.e. memory of camera etc. are completed during beginningization Hardware resource and software resource are ready, and global variable NUM value is set to 0, are receiving the application request of first application During with using camera resource, current NUM value is obtained first, and 1 is added to NUM value, and follow-up global variable NUM value, which follows, to be connect The number of the application request received and be incremented by, i.e., simultaneously when having N number of using the application of camera, NUM value is just N.So, so that it may The current application number of camera is got with the value by global variable NUM.
In a preferred embodiment, as shown in figure 3, creating second according to the described first application the step of Fig. 1 embodiment Virtual camera resource includes:
Step S1031, a dummy node is created, and memory space is distributed for the dummy node;
Step S1032, obtain described first and apply using after the application request of second application is received Video data in journey, and replicate the video data;
Step S1033, the video data after duplication is stored into memory space corresponding to the dummy node, generate institute State the second virtual camera resource.
In the present embodiment, a dummy node is created, dummy node indicates the original position of memory space, and is virtual section Point distributes a certain size memory space, to apply caused after the application request of the second application is received regard by first In memory space corresponding to frequency data Cun Chudao, the second virtual camera resource is generated.When subsequently creating virtual camera resource, together Sample needs to create memory space corresponding to another dummy node and distribution.
Wherein, if representing physics camera resource, F (A)=/dev/video (A) with F (A)("/dev/video herein (A) " it is resource store path);The dummy node of first application and its corresponding memory space are represented with N1, f1 (N1) represents One virtual camera resource, i.e. f1 (N1)=/virtual_dev/video (N1)("/virtual_dev/video (N1) " and money Source store path), then the second virtual camera resource can be expressed as f1 (N2)=Data (f1 (N1)), i.e. the second virtual camera money Source replicating video data from the first virtual camera resource.
In a preferred embodiment, as shown in figure 4, on the basis of the embodiment shown in Fig. 1, this method also includes step 105:When receiving the cancellation request for cancelling the first application or the second application, first is virtual corresponding to deletion first application Camera resource or the corresponding second virtual camera money of the second application.
Wherein, when receiving the cancellation request for cancelling the first application or the second application, subtract 1 to global variable NUM value, The first virtual camera resource corresponding to the first application or the corresponding second virtual camera money of the second application are deleted, similarly, is being connect When receiving the cancellation request of subsequent applications, virtual camera resource corresponding to subsequent applications is deleted, by that analogy.
The present embodiment is specially:Delete the dummy node and video of the first virtual camera resource or the second virtual camera resource Data, with the memory space of the dummy node and video data of the application of release first or the second application, camera resource is saved, is improved The operating capability of camera.
As shown in figure 5, the present invention also provides a kind of application apparatus of camera resource, including:
Acquisition module 101, for when receiving the application request of the first application, according to obtaining the application request The current application number of camera;
In the present embodiment, camera can be embedded intelligent terminal either in the equipment such as intelligent television or computer, and answer With program installation in the apparatus.By taking intelligent television as an example, its application is taken pictures including the use of this ground camera and video is chatted My god, using camera carry out recognition of face or gesture identification to be remotely controlled operation, using network album function of camera etc..
Wherein, the camera resource in the present embodiment includes physics camera resource and virtual camera resource.Physics camera resource The software resource being related in the course of the work including hardware resource and camera, hardware resource include camera lens, imaging sensor, synchronization Signal generator, CCD drivers, picture signal form circuit, power circuit etc.;Software resource includes image processing program, figure As condensing routine and other call above-mentioned hardware resources and interface program etc..Virtual camera resource in physics camera resource Through being created in the case of use, basis is provided using camera simultaneously for more applications so that multiple applications can use phase simultaneously Machine, it for details, reference can be made to the relevant portion in following embodiments.
First distribute module 102, for the first virtualphase that when the application number is at least one, will be pre-created Machine resource allocation to described first using.
Wherein, when application number is at least one, that is, there is one or more to apply and using camera resource, now, the One distribute module 102 can by the first virtual camera resource allocation being pre-created to first using.
The first virtual camera resource and physics camera resource in the present embodiment is similar in form, and can complete phase All functions of machine, such as obtain video flowing or photo.Physics camera resource is the camera resource of equipment acquiescence, and it is being applied When, it is always supplied to first application for sending request and is used, that is, is supplied to upper one of the first application to send answering for request With being used.It is virtual by first upon receipt during the application request of the first continuous application after physics camera resource is by use Camera resource allocation to first using.For first virtual camera resource when creating, previous according to the described first application should With establishment, for example, the previous application of the first application is uses camera to carry out Video chat, during Video chat, camera Video flowing constantly is obtained as the data of the application and is stored in a space, while the data duplication portion is stored in another In space, as the first virtual camera resource, it can be seen that store obtained by camera and identical number in two spaces According to.In the application request of the subsequently received first application, such as the first application is gesture identification, then the first application can just make With the first virtual camera resource, i.e., video flowing or photo are obtained in the video flowing stored from another space, and further carry Gesture is taken, other functions of enabling in equipment carry out gesture identification.
In the present embodiment when creating the first virtual camera resource, it is also necessary to create the memory space of correlation, and pass through phase The interface of pass is coordinated, and multiple applications is carried out simultaneously.
Creation module 103, for creating the second virtual camera resource according to the described first application;
Wherein, the second virtual camera resource creates, the establishment of the second virtual camera resource when creating according to the first application It is essentially identical with the establishment of the first virtual camera resource, the relevant portion of above-mentioned steps 102 is specifically referred to, here is omitted.
Second distribute module 104, for described first using the first virtual camera resource during receive Second application application request when, will the second virtual camera resource allocation give described second using.
In the present embodiment, in the first virtual camera resource allocation that will be pre-created to first using rear, establishment mould Block 103 creates the second virtual camera resource according to the first application, while caused data in the first application are controlled, so as to The the second virtual camera resource created can use caused data in the first application.Same reason, by the second virtualphase Using rear, the 3rd virtual camera resource is created according to the second application to second for machine resource allocation, while in the second application Caused data are controlled, and caused data in the second application can be used so as to the 3rd virtual camera resource of establishment, by This, can provide basis using camera resource simultaneously for multiple applications.What deserves to be explained is in the present embodiment, provided in physics camera Upon receipt during the application request of the first continuous application, the first virtual camera resource allocation is answered to first by after use in source With use, after physics camera resource and the first virtual camera resource are by use, the application of the second continuous application upon receipt During request, by the second virtual camera resource allocation to second using, the like.
In addition, when receiving the application request of the second application or follow-up application request, need also exist for obtaining use The current application number of camera resource, that is, obtain global variable NUM value, and adds 1 to perform follow-up behaviour again NUM value Make.
The present embodiment the first virtual camera resource by use, according to previous application create virtual camera resource, So that follow-up application uses, when follow-up application also asks to use camera resource, will directly can create Virtual camera resource allocation uses to current application, without re-creating, improves the speed of camera resource allocation, convenient to use The use at family.
In a preferred embodiment, as shown in fig. 6, on the basis of Fig. 5 embodiment, acquisition module 101 includes:
Setting unit 1011, for pre-setting a global variable NUM;
Processing unit 1012, the initial value for after camera initialization, putting the global variable NUM is 0, and will The initial value of the global variable NUM follows the number of the application request received and is incremented by;
Acquiring unit 1013, for when receiving the application request of the first application, being obtained according to the global variable NUM The application number of the currently used camera resource of camera.
Wherein, the current application number of camera is obtained concretely:A global variable NUM can be pre-set, at the beginning of camera The initialization to camera and its memory space, and global variable NUM initialization, i.e. memory of camera etc. are completed during beginningization Hardware resource and software resource are ready, and global variable NUM value is set to 0, are receiving the application request of first application During with using camera resource, current NUM value is obtained first, and 1 is added to NUM value, and follow-up global variable NUM value, which follows, to be connect The number of the application request received and be incremented by, i.e., simultaneously when having N number of using the application of camera, NUM value is just N.So, so that it may The current application number of camera is got with the value by global variable NUM.
In a preferred embodiment, as shown in fig. 7, on the basis of Fig. 5 embodiment, creation module 103 includes:
Creating unit 1031, memory space is distributed for creating a dummy node, and for the dummy node;
Copied cells 1032, the use after the application request of second application is received is applied for acquisition first During video data, and replicate the video data;
Generation unit 1033, for the video data storage after duplication to be arrived into memory space corresponding to the dummy node In, generate the second virtual camera resource.
In the present embodiment, a dummy node is created, dummy node indicates the original position of memory space, and is virtual section Point distributes a certain size memory space, to apply caused after the application request of the second application is received regard by first In memory space corresponding to frequency data Cun Chudao, the second virtual camera resource is generated.When subsequently creating virtual camera resource, together Sample needs to create memory space corresponding to another dummy node and distribution.
Wherein, if representing physics camera resource, F (A)=/dev/video (A) with F (A)("/dev/video herein (A) " it is resource store path);The dummy node of first application and its corresponding memory space are represented with N1, f1 (N1) represents One virtual camera resource, i.e. f1 (N1)=/virtual_dev/video (N1)("/virtual_dev/video (N1) " and money Source store path), then the second virtual camera resource can be expressed as f1 (N2)=Data (f1 (N1)), i.e. the second virtual camera money Source replicating video data from the first virtual camera resource.
In a preferred embodiment, as shown in figure 8, on the basis of the embodiment shown in Fig. 5, the present apparatus also includes deleting Module 105, for when receiving the cancellation request for cancelling the first application or the second application, deleting corresponding to first application First virtual camera resource or the corresponding second virtual camera money of the second application.
Wherein, when receiving the cancellation request for cancelling the first application or the second application, subtract 1 to global variable NUM value, The first virtual camera resource corresponding to the first application or the corresponding second virtual camera money of the second application are deleted, similarly, is being connect When receiving the cancellation request of subsequent applications, virtual camera resource corresponding to subsequent applications is deleted, by that analogy.
The present embodiment is specially:Delete the dummy node and video of the first virtual camera resource or the second virtual camera resource Data, with the memory space of the dummy node and video data of the application of release first or the second application, camera resource is saved, is improved The operating capability of camera.
The application process and device of a kind of camera resource provided by the invention, the application number current to camera are sentenced It is fixed, if having had one or more using the first virtual camera that when using camera resource at the same time, will can be pre-created Resource allocation uses to the application of current request, while creates the second virtual camera resource, by the second virtual camera resource point Dispensing subsequent applications use, due to that can complete all work(of camera using virtual camera resource and using physics camera resource Can, video flowing or photo are such as obtained, therefore more applications can be realized while use camera resource;In addition, the present invention more should When using camera resource with request, directly virtual camera resource can be distributed according to application request, it is not necessary to which application is carried out with equipment Cumbersome interaction, realize that logic is simpler, simplify operating process.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.Embodiment party more than The description of formula, it is required general that those skilled in the art can be understood that above-described embodiment method can add by software The mode of hardware platform is realized, naturally it is also possible to which by hardware, but the former is more preferably embodiment in many cases.It is based on Such understanding, the part that technical scheme substantially contributes to prior art in other words can be with software products Form embody, the computer software product is stored in a storage medium(Such as ROM/RAM, magnetic disc, CD)In, including Some instructions are causing a station terminal equipment(Can be mobile phone, computer, server, or network equipment etc.)Perform this hair Method described in bright each embodiment.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (8)

1. a kind of application process of camera resource, it is characterised in that comprise the following steps:
When receiving the application request of the first application, the application of currently used camera resource is obtained according to the application request Number;
When the application number is at least one, by the first virtual camera resource allocation being pre-created to the described first application Use;
Second virtual camera resource is created according to the described first application, data caused by the described first application are controlled, with Toilet states the second virtual camera resource and uses caused data in the described first application;
Described first using the first virtual camera resource during receive the application request of the second application when, by institute State the second virtual camera resource allocation to described second using;
The first virtual camera resource and the second virtual camera resource have all functions of camera.
2. the method as described in claim 1, it is characterised in that it is described when receiving the application request of the first application, according to The step of application number of the currently used camera resource of the application request acquisition, includes:
Pre-set a global variable NUM;
After camera initialization, the initial value for putting the global variable NUM is 0, and by the initial of the global variable NUM Value follows the number of the application request received and is incremented by;
When receiving the application request of the first application, the currently used camera of camera is obtained according to the global variable NUM The application number of resource.
3. the method as described in claim 1, it is characterised in that described that second virtual camera money is created according to the described first application The step of source, includes:
A dummy node is created, and memory space is distributed for the dummy node;
Obtain described first apply receive it is described second application application request after use during video data,
And replicate the video data;
Video data after duplication is stored into memory space corresponding to the dummy node, generates second virtual camera Resource.
4. the method as described in claim any one of 1-3, it is characterised in that also include:When receive cancel first application or Second application cancellation request when, delete it is described first application corresponding to the first virtual camera resource or second application it is corresponding Second virtual camera resource.
A kind of 5. application apparatus of camera resource, it is characterised in that including:
Acquisition module, for when receiving the application request of the first application, currently used phase to be obtained according to the application request The application number of machine resource;
First distribute module, for the first virtual camera resource that when the application number is at least one, will be pre-created Distribute to described first using;
Creation module, for creating the second virtual camera resource according to the described first application, and to caused by the described first application Data are controlled, so that the second virtual camera resource uses caused data in the described first application;
Second distribute module, for described first using the first virtual camera resource during receive the second application Application request when, by the second virtual camera resource allocation to described second using;
The first virtual camera resource and the second virtual camera resource have all functions of camera.
6. device as claimed in claim 5, it is characterised in that the acquisition module includes:
Setting unit, for pre-setting a global variable NUM;
Processing unit, the initial value for after camera initialization, putting the global variable NUM is 0, and by the overall situation Variable NUM initial value follows the number of the application request received and is incremented by;
Acquiring unit, for when receiving the application request of the first application, the camera to be obtained according to the global variable NUM The application number of currently used camera resource.
7. device as claimed in claim 5, it is characterised in that the creation module includes:
Creating unit, for creating a dummy node according to the described first application, and memory space is distributed for the dummy node;
Copied cells, applied for obtaining first during the use after receiving the application request of second application Video data, and replicate the video data;
Generation unit, for the video data after duplication to be stored into memory space corresponding to the dummy node, generate institute State the second virtual camera resource.
8. the device as described in claim any one of 5-7, it is characterised in that also including removing module, taken for working as to receive Disappear the first application or second application cancellation request when, delete it is described first application corresponding to the first virtual camera resource or second The corresponding second virtual camera money of application.
CN201410092530.3A 2014-03-13 2014-03-13 The application process and device of camera resource Active CN104918112B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410092530.3A CN104918112B (en) 2014-03-13 2014-03-13 The application process and device of camera resource

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410092530.3A CN104918112B (en) 2014-03-13 2014-03-13 The application process and device of camera resource

Publications (2)

Publication Number Publication Date
CN104918112A CN104918112A (en) 2015-09-16
CN104918112B true CN104918112B (en) 2018-01-19

Family

ID=54086753

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410092530.3A Active CN104918112B (en) 2014-03-13 2014-03-13 The application process and device of camera resource

Country Status (1)

Country Link
CN (1) CN104918112B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808353A (en) * 2016-03-08 2016-07-27 珠海全志科技股份有限公司 Camera resource sharing method and device
CN106060648A (en) * 2016-06-07 2016-10-26 青岛海信电器股份有限公司 Audio data transmission method and smart television
CN111327758B (en) * 2018-12-17 2022-08-02 中兴通讯股份有限公司 Camera sharing method and device
CN112749022B (en) * 2019-10-29 2024-05-31 阿里巴巴集团控股有限公司 Camera resource access method, operating system, terminal and virtual camera
CN111343412B (en) * 2020-03-31 2021-08-17 联想(北京)有限公司 Image processing method and electronic equipment
CN111638966A (en) * 2020-05-28 2020-09-08 维沃移动通信有限公司 Resource acquisition method and device and electronic equipment
CN114422837B (en) * 2022-01-25 2023-08-18 成都鼎桥通信技术有限公司 Method, device, equipment and medium for sharing media data by multiple applications

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667143A (en) * 2009-09-18 2010-03-10 北京中星微电子有限公司 Video data processing system and method
CN101594510B (en) * 2009-06-23 2011-11-23 腾讯科技(深圳)有限公司 Method and system for achieving camera resource sharing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594510B (en) * 2009-06-23 2011-11-23 腾讯科技(深圳)有限公司 Method and system for achieving camera resource sharing
CN101667143A (en) * 2009-09-18 2010-03-10 北京中星微电子有限公司 Video data processing system and method

Also Published As

Publication number Publication date
CN104918112A (en) 2015-09-16

Similar Documents

Publication Publication Date Title
CN104918112B (en) The application process and device of camera resource
CN104639424B (en) Data transmission method and related equipment and system
CN106453572B (en) Method and system based on Cloud Server synchronous images
CN106658079A (en) Customized expression image generation method and device
CN110490808A (en) Picture joining method, device, terminal and storage medium
CN104580930A (en) Group photo taking method and system
CN111225291B (en) Video creation method, device, terminal equipment and storage medium
CN106940880A (en) A kind of U.S. face processing method, device and terminal device
CN109358791A (en) A kind of screenshot method, device, storage medium and mobile terminal
CN109033393B (en) Sticker processing method, device, storage medium and electronic equipment
CN105207886A (en) Instant messaging (IM) message sending and display methods, IM message sending and display devices, and IM message system
CN108712320A (en) Information push method and device
CN106657785A (en) Camera operation control method and camera operation control device
KR101692909B1 (en) Method and system for providing video conference using screen mirroring
CN103617028A (en) Collaborative document comment method and collaborative document comment device
CN107222618A (en) Terminal screenshotss method and device
CN108780541A (en) Contact person creates and utilizes
CN103648047A (en) Resource searching method and system of intelligent television
CN111562985B (en) Resource management method and device, electronic equipment and storage medium
CN103873631B (en) Method and device for displaying call interface of mobile terminal
CN107368376B (en) Message sending method and device, expansion method and terminal
CN104516774A (en) Operation method of remote application, terminal and server
CN113420133B (en) Session processing method, device, equipment and storage medium
CN113691526A (en) Pushing method, device, system, equipment and medium based on WebRTC
CN104935647A (en) File sharing method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant