CN104980660B - A kind of mute method taken pictures of Android platform - Google Patents
A kind of mute method taken pictures of Android platform Download PDFInfo
- Publication number
- CN104980660B CN104980660B CN201510402820.8A CN201510402820A CN104980660B CN 104980660 B CN104980660 B CN 104980660B CN 201510402820 A CN201510402820 A CN 201510402820A CN 104980660 B CN104980660 B CN 104980660B
- Authority
- CN
- China
- Prior art keywords
- preview
- data
- preview frame
- android
- view
- 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
Links
Landscapes
- Studio Devices (AREA)
Abstract
The present invention relates to Android platform field of photographing technology, provide a kind of mute method taken pictures of Android platform, and step includes: the camera function for starting Android device;Start preview;Register preview frame readjustment;Obtain preview frame data;Judge whether user triggers photographing operation, returns and walk if "No", if "Yes" continues;Cancel preview frame readjustment;Stop preview;Picture data is converted by preview frame data;Picture data acquisition is saved to be taken a picture.The present invention is suitable for thoroughly solving the problems, such as to take pictures the elimination of prompt tone, and can be used for all Android types.
Description
Technical field
The present invention relates to Android platform field of photographing technology, issue more particularly to how to hide system when taking pictures
Prompt tone of taking pictures method.
Technical background
In the scene at present using mobile phone photograph, has under many scenes to achieve the purpose that candid photograph, need do not shying
Photographic process is completed in the case where the dynamic target that is taken, but due to the limitation of android system, is taken pictures on different mobile phones
Shi Junhui issues prompt tone of taking pictures, and current existing some technical solutions can be mentioned when taking pictures with taking pictures on hidden parts mobile phone
Show sound, but can not come into force on all mobile phones.
Traditional Android phone is taken pictures process, is carried out processing of taking pictures using takePicture method, is being passed through
When takePicture method is taken pictures, android system can be searched/system/media/audio/ui catalogue under take pictures
Prompt tone file plays out, and since this catalogue belongs to the catalogue of system level, can not be forbidden by the modification of application program
Broadcasting of the system for this document.
In the prior art, the problem of having the modification mode of some applications can be to traditional scheme, carries out some improvement:
TakePicture method is called to need to transmit a parameter ShutterCallback, mobile phone is worked as in the expression of this parameter
Treatment process when space shooting shutter is triggered, here can be by setting empty for this parameter, in this way can on the type of part
With no prompt tone that achievees the effect that take pictures;
The prompt tone of taking pictures of part type equally can also be controlled by system sound volume, and system sound volume is in android system
Can be by application program controlling, therefore mobile phone can be adjusted to silent mode before takePicture, then obtaining
To restoring original volume mode after photo, mute take pictures is achieved the purpose that with this;
By carrying out Root operation (obtaining Administrator Level's permission) to Android phone ,/system/ is deleted
Corresponding audio files of taking pictures, also can achieve when taking pictures since audio files is not present in this way under media/audio/ui
The mute effect taken pictures.
Above-mentioned three kinds of methods can achieve the effect that eliminate prompt tone of taking pictures on the type of part, but still have part machine
Type can not solve this problem, prompt tone of taking pictures perfect can not be eliminated in such a way that takePicture obtains photo, just because such as
This, a kind of method for finding prompt tone that thoroughly solves to take pictures has important theory and realistic meaning.
Summary of the invention
On the basis of in view of the shortcomings of the prior art, the purpose of the present invention is to provide a kind of mute bats of Android platform
According to method, the elimination for the prompt tone that thoroughly to solve the problems, such as to take pictures, and can be used for all Android types to hide prompt of taking pictures
Sound.
The present invention provides a kind of Android platform the mute method taken pictures, mainly including the following steps:
(1) start the camera function of Android device;
(2) start preview;
(3) registration preview frame readjustment;
(4) obtain preview frame data: with variation of finding a view, phase chance, which will ceaselessly pass through onPreviewFrame method, to be taken
Scape data return to application program;
(5) judge whether user triggers photographing operation, return and walk if "No", if "Yes" continues: application program needs
Judge whether active user triggers photographing operation, if not triggering photographing operation, application program can take what is currently obtained
Scape data directly abandon, and return step (4), if triggering photographing operation, continue photo processing, step (4) and step
Suddenly (5) circulation carries out;
(6) cancel preview frame readjustment;
(7) stop preview;
(8) picture data is converted by preview frame data;
(9) picture data acquisition is saved to be taken a picture.
Further, in step (3), make camera after the data for getting each frame all by the side onPreviewFrame
Preview frame data are returned to application program by method.
Further, preview frame data format is yuv format.
Further, in step (6) and step (7), return to camera no longer to application program by the two steps any
It finds a view data, to guarantee that the photo saved is consistent with the picture of finding a view that user finally sees at interface of finding a view.
Further, in step (8), preview frame data yuv format is carried out by the YUVImage class that android system provides
To the conversion of picture data jpeg format.
The method of the present invention be using the preview frame data for middle acquisition of finding a view as last picture data based on.It was finding a view
Cheng Zhong, phase chance ceaselessly return to data of finding a view, therefore, when user presses shutter, it is only necessary to taking for moment at that time
Scape pause, while the image for immediately obtaining last frame be converted into jpeg image format carry out save can be obtained photo of taking pictures.
This shooting style is not needed through takePicture method, therefore can be limited around system, and no longer automatic playing system is pre-
The prompt tone of taking pictures set, and the prompt tone for wanting to issue when taking pictures can be defined on by developer oneself.Therefore can have
The elimination of prompt tone is issued when effect solves the problems, such as to take pictures, and is suitable for all Android platforms.
After the detailed description of embodiment of the present invention is read in conjunction with the figure, the other features and advantages of the invention will become more
Add clear.
Detailed description of the invention
Present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments:
Fig. 1 is of the invention for the mute method flow diagram taken pictures of Android platform.
Specific embodiment
It to make the objectives, technical solutions, and advantages of the present invention clearer, below will be to specific embodiment party of the invention
Formula is described in further detail.
Referring to Fig. 1, the present embodiment is suitable for the mute method taken pictures of Android platform, including the following steps:
(1) start the camera function of Android device;
In the present embodiment, for user in the camera function for pressing Android device, which enters state of taking pictures.
(2) start preview;
In the present embodiment, it is found a view picture using the preview of camera view interface.
(3) registration preview frame readjustment;
Return camera, all by onPreviewFrame method, by preview frame data after the data for getting each frame
Return application program;
Wherein preview frame data format is yuv format;
OnPreviewFrame method is exactly the callback method for obtaining yuv format data, is by Android platform
In the application program of camera, it will be realized by being set using call back function setPreviewCallback pair
The calling of onPreviewFrame interface, so that the data for obtaining each frame, which form preview frame data, returns to application program.
(4) preview frame data are obtained;
With variation of finding a view, phase chance ceaselessly passes through the onPreviewFrame method data that will find a view and returns to using journey
Sequence.
(5) judge whether user triggers photographing operation, return and walk if "No", if "Yes" continues;
Application program needs to judge whether active user triggers photographing operation, if not triggering photographing operation, application program
The data of finding a view currently obtained can directly be abandoned, return step (4) continues at photo if triggering photographing operation
Reason.
(6) cancel preview frame readjustment;
(7) stop preview;
Camera is set no longer to return to any data of finding a view to application program by step (6) and step (7), to guarantee preservation
Photo is consistent with the picture of finding a view that user finally sees at interface of finding a view.
(8) picture data is converted by preview frame data;
Preview frame data yuv format is carried out to picture data JPEG lattice by the YUVImage class that android system provides
The conversion of formula;
Byte data is configured to YUVImage object by YUVImage class, then calls YUVImage object
Compress To Jpeg () obtains JPEG picture.
(9) picture data acquisition is saved to be taken a picture.
Finally, it is stated that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although referring to compared with
Good embodiment describes the invention in detail, those skilled in the art should understand that, it can be to skill of the invention
Art scheme is modified or replaced equivalently, and without departing from the objective and range of technical solution of the present invention, should all be covered at this
In the scope of the claims of invention.
Claims (5)
1. a kind of mute method taken pictures of Android platform, it is characterised in that including the following steps:
(1) start the camera function of Android device;
(2) start preview;
(3) registration preview frame readjustment;
(4) obtain preview frame data: with variation of finding a view, phase chance, which ceaselessly passes through onPreviewFrame method, will find a view number
According to returning to application program;
(5) judge whether user triggers photographing operation, return and walk if "No", if "Yes" continues: application program needs are sentenced
Whether disconnected active user triggers photographing operation, if not triggering photographing operation, number of finding a view that application program will can currently obtain
According to directly discarding, and return step (4), if triggering photographing operation, continue photo processing, step (4) and step (5)
Circulation carries out;
(6) cancel preview frame readjustment;
(7) stop preview;
(8) picture data is converted by preview frame data;
(9) picture data acquisition is saved to be taken a picture.
2. a kind of mute method taken pictures of Android platform according to claim 1, which is characterized in that in step (3), make
Camera, all by onPreviewFrame method, preview frame data is returned and apply journey after the data for getting each frame
Sequence.
3. a kind of mute method taken pictures of Android platform according to claim 2, which is characterized in that preview frame data lattice
Formula is yuv format.
4. a kind of mute method taken pictures of Android platform according to claim 1, which is characterized in that step (6) and step
(7) in, camera is made no longer to return to any data of finding a view to application program, to guarantee that the photo saved and user are finding a view interface most
The picture of finding a view seen afterwards is consistent.
5. according to claim 1 or the 3 a kind of mute methods taken pictures of Android platform, which is characterized in that in step (8),
The conversion of preview frame data yuv format to picture data jpeg format is carried out by the YUVImage class that android system provides.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510402820.8A CN104980660B (en) | 2015-07-10 | 2015-07-10 | A kind of mute method taken pictures of Android platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510402820.8A CN104980660B (en) | 2015-07-10 | 2015-07-10 | A kind of mute method taken pictures of Android platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104980660A CN104980660A (en) | 2015-10-14 |
CN104980660B true CN104980660B (en) | 2019-01-04 |
Family
ID=54276711
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510402820.8A Active CN104980660B (en) | 2015-07-10 | 2015-07-10 | A kind of mute method taken pictures of Android platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104980660B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105472259A (en) * | 2016-01-21 | 2016-04-06 | 腾讯科技(深圳)有限公司 | Image processing method and device, and terminal |
CN105933597A (en) * | 2016-04-19 | 2016-09-07 | 乐视控股(北京)有限公司 | Prompting method of terminal and terminal |
CN106603910B (en) * | 2016-11-28 | 2020-09-04 | 上海传英信息技术有限公司 | Photo storage method based on intelligent terminal |
CN109068059B (en) * | 2018-08-27 | 2020-09-11 | Oppo广东移动通信有限公司 | Method for calling camera, mobile terminal and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103544221A (en) * | 2013-09-30 | 2014-01-29 | Tcl集团股份有限公司 | Method and system for generating video thumbnail in Android system |
CN103716535A (en) * | 2013-12-12 | 2014-04-09 | 乐视致新电子科技(天津)有限公司 | Method for switching photographing mode, and electronic device |
-
2015
- 2015-07-10 CN CN201510402820.8A patent/CN104980660B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103544221A (en) * | 2013-09-30 | 2014-01-29 | Tcl集团股份有限公司 | Method and system for generating video thumbnail in Android system |
CN103716535A (en) * | 2013-12-12 | 2014-04-09 | 乐视致新电子科技(天津)有限公司 | Method for switching photographing mode, and electronic device |
Non-Patent Citations (1)
Title |
---|
基于计算机摄像头的图像采集和变换的设计;李松柏,尚海;《计量与测试技术》;20131126;第40卷(第10期);参见第27页-28页,附图1-2 |
Also Published As
Publication number | Publication date |
---|---|
CN104980660A (en) | 2015-10-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11470294B2 (en) | Method, device, and storage medium for converting image from raw format to RGB format | |
CN104980660B (en) | A kind of mute method taken pictures of Android platform | |
KR101790679B1 (en) | Mobile terminal and method for starting shooting on mobile terminal | |
WO2017096857A1 (en) | Method and device for adjusting photographing parameter of camera | |
KR101949832B1 (en) | Picture displaying method, apparatus and terminal device | |
CN109495689B (en) | Shooting method and device, electronic equipment and storage medium | |
CN103428555B (en) | A kind of synthetic method of multimedia file, system and application process | |
US20170163878A1 (en) | Method and electronic device for adjusting shooting parameters of camera | |
WO2014154003A1 (en) | Method and apparatus for displaying self-taken images | |
CN105898364A (en) | Video playing processing method, device, terminal and system | |
US20160119534A1 (en) | Photographing method and terminal | |
US9124548B2 (en) | Method for uploading media file, electronic device using the same, and non-transitory storage medium | |
EP2890115B1 (en) | Electronic photographing apparatus and method of control | |
CN109922252B (en) | Short video generation method and device and electronic equipment | |
CN104683677B (en) | Increase the system and method for voice description for photo | |
WO2017076041A1 (en) | Method and device for image-stabilized photograph capturing and mobile terminal | |
US9756195B2 (en) | Communication apparatus capable of communicating with external apparatus, control method for communication apparatus, and storage medium | |
KR20130094632A (en) | Apparatus and method for processing a continuous shooting mode in camera device | |
CN111461950A (en) | Image processing method and device | |
CN116416323A (en) | Image processing method and device, electronic equipment and storage medium | |
US10728451B2 (en) | Communication device for communicating with external device, method for controlling the same, and recording medium | |
US20200186586A1 (en) | Communication apparatus capable of communicating with external apparatus, method for controlling communication apparatus, and recording medium | |
CN105450922A (en) | Shooting processing method and device | |
CN103024268A (en) | Photographing method based on guides and prompts of sound information | |
KR101567668B1 (en) | Smartphones camera apparatus for generating video signal by multi-focus and method thereof |
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 | ||
CP02 | Change in the address of a patent holder | ||
CP02 | Change in the address of a patent holder |
Address after: 610041 the 13 floor of No. 1 middle Tianfu Avenue, No. 1268, high-tech zone, Chengdu, Sichuan. Patentee after: Chengdu PinGuo Digital Entertainment Ltd. Address before: 610041 No. 216 South City Road, Chengdu hi tech Zone, Sichuan Patentee before: Chengdu PinGuo Digital Entertainment Ltd. |