Camera mod for 2D gallery - CM6 Froyo roms? - Hero CDMA Themes and Apps

Would anyone be able to modify the Camera apk so when you click on the image in the lower right corner of the last taken photo to open it in the gallery?
Right now a workaround to get to the gallery from the camera app is to hit Menu, Gallery.
Wondering if anyone can get the button working?

+1 I would like to see this too.
Tried myself a little. I believe the command for launching the review of the phone is
Code:
com.cooliris.media.action.REVIEW
The problem is that only the 3D Gallery is called, com.cooliris.media
The 2D Gallery is known has, com.android.camera.Camera
I tried swapping them out, but it just results in the camera app now showing up.
Maybe the 2D Gallery doesn't have a review command and this isn't even possible.
OK so a little more digging and trying and no success.
It appears that the 2D Gallery and 3D Gallery seem to appear to handle the "Reviewing of images differently"
2D:
Code:
com.android.camera.ReviewImage
and that seems to be it's own separate activity
whereas
3D:
Code:
com.cooliris.media.action.REVIEW
and is a action inside of the Gallery activity
It appears that there is no equivalent review action with the 2D Gallery, so it can easily be swapped out in the Camera.apk via a hex editor or the like. I would assume a change in the source code for the Camera.apk would be needed.
Would be nice to have it coded so it looks for 3D gallery 1st and if that fails falls back on 2D.
More digging found me this:
http://ip208-100-42-21.static.xda-developers.com/showthread.php?t=731659&page=96
Seems to exactly what you are looking for Jedis.

To get the Camera thumbnail to stop calling Gallery3D, I made the following change in the Camera source.
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java
index 44d5681..52a6639 100644
--- a/src/com/android/camera/Util.java
+++ b/src/com/android/camera/Util.java
@@ -42,7 +42,7 @@ public class Util {
public static final int DIRECTION_UP = 2;
public static final int DIRECTION_DOWN = 3;
- public static final String REVIEW_ACTION = "com.cooliris.media.action.REVIEW";
+ public static final String REVIEW_ACTION = "android.intent.action.VIEW";
private Util() {
}
There may be a better way, but this is working for me.

Related

Screen rotation on Tornado WM6??

The question was: Is the screen rotation possible on Tornado devices (for example for better Internet browsing).
Many efforts were done to gain this possibility. We have not fully received what we need, but we're on good way. We know now that the standard Tornado DDI.DLL driver is uncapable of screen rotation, so we (partially) replaced it with one taken from HTC Vox ROM. There is one serious disadvantage we're still working about: the joystick doesn't follow orientation for now, so using the phone in landscape mode is seriously difficult. We will be trying to adopt the Vox's keybddr.dll into Tornados.
I have collected all these things in an application, that you can install to skip manual registry editing.
Here is the application:
http://www.mediadrain.com/TDM_1.0.0.cab
You MUST install the following certificates! If not, a hard reset will be required!
http://www.mediadrain.com/WMtequan.cab
To rotate the screen select Change Driver option from the Display Driver option, and change to a VOX one.
i don't think it will be supported on this alpha version...!!!
qtek_metanol said:
i don't think it will be supported on this alpha version...!!!
Click to expand...
Click to collapse
this isn't connected
OS either supports screen rotation or not
WM6 supports screen rotation, like on the vox, so surely we could do the same for tornado but add some start menu shortcuts or a home screen plugin to make it rotate?
Phil
i tried writing an app in .net compact framework. While it worked and rotated a PPC WM5, it didn't work in my SP WM6.
maybe .net is hard-coded and disallows screen rotation on smartphone, what doesn't mean it's impossible
WM6 supports screen rotation, like on the vox, so surely we could do the same for tornado but add some start menu shortcuts or a home screen plugin to make it rotate
Click to expand...
Click to collapse
may you need the dll file from VOX which enable the screen rotation by opening the keyboard
i think we should write a list with Q&A, and other with Bugs, Do have somebody a list with a resume of troubles...??
i build a .NET project that allow to rotate the screen, but for me it works ONLY on emulator SDK only in both WM5 and WM6 why? i post the exe and the source.. give me some answer..
Code:
#include <windows.h>
#include <stdafx.h>
int
WINAPI
WinMain(
HINSTANCE,
HINSTANCE,
#ifdef UNDER_CE
LPWSTR,
#else
LPSTR,
#endif
int
)
{
DEVMODE DevMode;
int RotationAngles;
int CurrentAngle;
int NewAngle;
//
// Check for rotation support by getting the rotation angles supported.
//
memset (&DevMode, 0, sizeof (DevMode));
DevMode.dmSize = sizeof (DevMode);
DevMode.dmFields = DM_DISPLAYQUERYORIENTATION;
if (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_TEST, NULL))
{
RotationAngles = DevMode.dmDisplayOrientation;
RETAILMSG(1, (L"ChangeDisplaySettingsEx supports these rotation angles %d", RotationAngles));
}
else
{
RETAILMSG(1, (L"ChangeDisplaySettingsEx failed to get the supported rotation angles."));
RotationAngles = -1;
}
//
// Get the current rotation angle.
//
memset(&DevMode, 0, sizeof (DevMode));
DevMode.dmSize = sizeof (DevMode);
DevMode.dmFields = DM_DISPLAYORIENTATION;
if (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_TEST, NULL))
{
CurrentAngle = DevMode.dmDisplayOrientation;
RETAILMSG(1, (L"ChangeDisplaySettingsEx reports the current rotation as %d", CurrentAngle));
}
else
{
RETAILMSG(1, (L"ChangeDisplaySettingsEx failed to get the current rotation angle."));
CurrentAngle = -1;
}
//
// Rotate to the "next" angle.
//
if (CurrentAngle >= 0 && RotationAngles >= 0)
{
NewAngle = CurrentAngle;
do
{
NewAngle <<= 1;
if (NewAngle == DMDO_0)
{
NewAngle = DMDO_90;
}
if (NewAngle > DMDO_270)
{
NewAngle = DMDO_0;
}
} while (!(NewAngle & RotationAngles) && (NewAngle != DMDO_0));
memset(&DevMode, 0, sizeof (DevMode));
DevMode.dmSize = sizeof (DevMode);
DevMode.dmFields = DM_DISPLAYORIENTATION;
DevMode.dmDisplayOrientation = NewAngle;
if (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_RESET, NULL))
{
RETAILMSG(1, (L"ChangeDisplaySettingsEx changed rotation angle to %d", NewAngle));
}
else
{
RETAILMSG(1, (L"ChangeDisplaySettingsEx failed to change the rotation angle to %d", NewAngle));
}
}
return 0;
}
giuseppebitonti said:
i build a .NET project that allow to rotate the screen, but for me it works ONLY on emulator SDK only in both WM5 and WM6 why? i post the exe and the source.. give me some answer..
Click to expand...
Click to collapse
Hey, I have a Vox (s710) for a few days so I could search which application is used by this phone to rotate the screen.
kartam said:
Hey, I have a Vox (s710) for a few days so I could search which application is used by this phone to rotate the screen.
Click to expand...
Click to collapse
that would be great mate. we'll be waiting for it.
bad news...
i found this somewhere in eMbedded VC++ documentation:
Screen rotation requires support from the display driver, which maintains information regarding rotation. Screen rotation is currently supported only on devices that use a single screen and is not supported on multiple screen devices.
An application calls the ChangeDisplaySettingsEx function to determine the screen orientation modes that the system supports, to set the angle by which the screen is rotated, and to query the current angle of rotation
Click to expand...
Click to collapse
I've written small utility (C++, native code just to be sure that no funny hardcode in compact framework is messing) and i've tested it on SPV C600 and TYTNII. On TYTN all was OK (screen rotated), on C600 (WM6) error was 'DISP_CHANGE_BADMODE' - exactly like described in docs...
so (IMHO): display driver (heh.. I suspected that there is sth like display driver ) just does not support screen rotation, so no matter that WM6 supports it...
we got two choices:
- find better one (heh... i do not even know the name of the file... but this i can find - i think i saw it once where i was plaing with regedit )
- live with 0 degrees rotation
It is necessary patch driver from vox. It approaches, but incorrectly turnoff screen. Illumination does not die away, and after that the image is displaced on 15 pixels to the right. With the all perfectly rotates. Except for joystick...
kmz said:
It is necessary patch driver from vox. It approaches, but incorrectly turnoff screen. Illumination does not die away, and after that the image is displaced on 15 pixels to the right. With the all perfectly rotates. Except for joystick...
Click to expand...
Click to collapse
could you uploader the driver plz
How can I find the driver in the ROM?
http://kmz.ho.com.ua/dispdriver.vox.zip
Here the driver and the certificate by which is signed the driver.
so we got POC done, now time for hard reset
driver supports screen rotation, but it got problems with display time out - when backlight should be off it is on, but screen becomes white and it's premament (until reboot).
Just for info - U can use MyMobiler to operate - no matter that screen is dead, phone itself is still doing his job
Hey, that is great
Good job guys, i'm sure you guys can improve it.
Just some suggestion, perhaps you can make some application which will toggle landscape/potrait and map it to one of the shortcut keys such as long_volup
driver supports screen rotation, but it got problems with display time out - when backlight should be off it is on, but screen becomes white and it's premament (until reboot).
Just for info - U can use MyMobiler to operate - no matter that screen is dead, phone itself is still doing his job
Click to expand...
Click to collapse
Excelent work Qlphn, what about the joystick control? It changes the way to control the Joystick when you switch to Panorama Modus?
THX
Has anyone got the Tornado display driver? I could probably check differences with windiff and hexedit it .
Hey!
I managed to do this with DDI driver you've attached.
Well, the joy doesn't follow orientation, screen rotation works. After some time my display takes weird colours. I hope this can be fixed anyway, well I will try to work it
Maybe only registry edit is required? I will compare vox registry with tornado one and say what I noticed.
Greetings

DirectShow Camera Control On TMobile Shadow

Hi All,
I am using DirectShow API for fetching camera contents on T-Mobile Shadow phone (manufacturer is HTC). I am having problem with the default Camera Zoom factor on this phone (when opened using DirectShow). I am trying to control the Zoom factor using IAMCameraControl interface. But I don't get any valid pointer for IAMCameraControl Inteface by using following code =>
$$$$$$$$$$$$$$$$$$$$$$$$$$$
long camera_flags = 0;
long zoom_val = 0;
IAMCameraControl* pCameraControl = NULL;
pVideoCaptureFilter->QueryInterface(IID_IAMCameraControl,(void**)&pCameraControl);
if(NULL == pCameraControl)
{
result = E_NOTIMPL;
goto error_handler;
}
$$$$$$$$$$$$$$$$$$$$$$$$$$$
Looks like IAMCameraControl has not been implemented on this particular phone. Is there any other way to change default Camera Zoom factor on HTC phones?
I came to know about HTC Camera DLL using this forum. How should I go about getting the Camera DLL and the documentation?
Thanks,
Shashi

[Q] Gallery3D Only support Portrait Mode phone?

Hi All,
we are now developing Android phone on mmp2 board which is of landscape mode. We found Galley3D works perfectly on portrait mode phone while has a problem on landscape one. As you know Gallery3D can tilt pictures/videos according to values of Gsensor. But the Gsensor’s coordinator on landscape mode phone is different from that of portrait. This difference make Galley3D’s not working well on our mmp2 board, i.e., Gallery3D only supports portrait mode phone. Below is for the details:
Let’s take a look at onSensoChanged function in file GridInputProcessor.java, Gallery3D calculates the tilt value from X-axis value (values [0]) / Y-axis value (values [1]) depends on the compare of current display’s width and height.
public void onSensorChanged(RenderView view, SensorEvent event, int state) {
…..
switch (event.sensor.getType()) {
case Sensor.TYPE_ACCELEROMETER:
float[] values = event.values;
/*tilt value is calculated from X-axis value (values [0]) / Y-axis value (values [1]) */
float valueToUse = (mCamera.mWidth < mCamera.mHeight) ? values[0] : -values[1];
float tiltValue = 0.8f * mPrevTiltValueLowPass + 0.2f * valueToUse;
…… }
break;
}
}
For Portrait mode phone:
(1) When Gallery3D is in Portrait mode, tiltValue uses value of X axis since mWidth < mHeight, Galley3D would tilt the pictures when X value of Gsensor changes, this behavior is expected.
(2) When Gallery3D is in Landscape mode, tiltValue uses value of Y axis since mWidth > mHeight, Galley3D would tilt the pictures when Y value of Gsenso changes, this behavior is expected.
/samba/PortraitMode.bmp
For Landscape mode phone:
(3) When Gallery3D is in Portrait mode, tiltValue uses value of Y axis since mWidth < mHeight, Galley3D would tilt the pictures when Y value of Gsensor changes changes, this behavior is unexpected.
(4) When Gallery3D is in Landscape mode, tiltValue uses value of X axis since mWidth > mHeight, Galley3D would tilt the pictures when value of X value of Gsensor changes, this behavior is unexpected.
/samba/LandscapeMode.bmp
Questions:
(1) Do we have solution to fix this issue? Is that in APP?
(2) There are some other Gsensor games in the market has the same issue, i.e., only support Portrait mode phone, e.g., the Teeter Game, is there any idea for the workaround in framework/SensorHAL so that those games can still be used in Landscape mode phone?
Hope above is clear; we are looking forward to your kindly reply and many thanks in advance.
it definitely supports landscape, I'm using it on my Dell streak using leaked eclair firm ware, quick is forced/ locked landscape.
unless Dell have altered the code, which can't tell because they won't release the source, can't really help much more than that. just to let you know that it works
Landscape works perfect on 3D gallery for my Evo with Froyo.
Can someone post an appbrain/androlib link or a QR code? I cannot find this app
It's a stock application...
Oh, mine is not called that. It's just "Gallery"

[MOD][FIX] Gallery3D - high-resolution, stock and HTC cameras [update 28-Apr-2011]

Since Enomther ported HTC camera to Nexus, one issue was plaguing it. The same issue is present for Desire users that like Gallery3D.
The default sort for folders in Gallery3D is ascending - the oldest photo is shown first, the newest is last. But since it's not comfortable for the "Camera" folder, in which you want to see the last made photo without scrolling to the end, it (and also "download" folder) is sorted descending - the latest photo shows on top.
When you use HTC Camera (or just happen to have Desire), it saves photos under 100MEDIA folder, which is sorted ascending, like any regular folder. And looking at the last taken photo becomes a long task.
So, to save HTC Camera users the pain, I've modified the Gallery3D. The default camera folder always shows in Gallery as "Camera", on the top of the list, and is sorted descending. I've adjusted it to suit the different actual folders.
Update log
v0.3
Changed to Edify scripting for installation on Clockworkmod 3.x.
v0.2
- Rebased Gallery3D on Cyanogen repo - performance increases and high-res patch built in.
- Single file for both stock and HTC Camera.
- If directory "DCIM/100MEDIA" exists on SD card, Gallery assumes HTC Camera mode, using 100MEDIA as default Camera folder. If not - it uses the regular Camera folder.
v0.1
- Based on Froyo AOSP repo, 2.2.1.
- Two versions: for stock Camera and for HTC Camera.
- Added high resolution Gallery3D patch by Number22.
- For HTC Camera version - Changed the Gallery3D to use "100MEDIA" as the default Camera folder.
Instructions
Flash corresponding ZIP in recovery. It refreshes the thumbnails (erases /sdcard/Android/data/com.cooliris.media) upon flash.
HTC Camera users on Nexus ROMs: if you have any photos left in your default "Camera" folder, you'll see 2 "Camera" folders in Gallery - one with camera icon and one with folder icon. To avoid confusion, please rename "Camera" folder to "OldCamera" before flashing or before running, or move the photos from there to "100MEDIA" folder.
Thanks go to Number22 for high res patch, Cyanogen for higher Gallery3D performance.
Source
Line 47, replace with:
Code:
public static final String CAMERA_STRING = getCameraName();
Line 53, add:
Code:
public static String getCameraName() {
if ((new File(Environment.getExternalStorageDirectory().toString() + "/DCIM/" + "100MEDIA")).exists()) {
return "100MEDIA";
}
return "Camera";
}
Ever since CM6 final (kangorama) my phone had not displayed any pictures in the gallery, it was useless pretty much this actually fixed my gallery and now everything is displayed. Thanks a million jack. Got a donation link??
You are the man! thanks
Initial testing is perfect. Thanks Jack.
Works great here too. Wish the high-resolution fix would be implemented into the stock gallery app in cm6 (if it hasnt already, i haven't checked in a while). Thanks!
if i install the stock camera ...would it change the folder that my camera saves the pictures it takes???..or will it stay as normal
it will only change if i had the HTC camera right?
screenie please? O
New pictures with wrong name ..
When a new picture is taken it appears with the wrong name and no geo tag (as you noted in the post in Enomthers' thread). I've restarted the gallery3D but this doesn't correct the issue. It only seems to be corrected with a reboot.
Is there something short of a reboot I can do to see the correct name / tag ?
helfone said:
screenie please? O
Click to expand...
Click to collapse
It looks the same as the stock gallery3d except the order of pictures in "Camera" is newest first and the quality of the pictures displayed is better.
Qwest905 said:
if i install the stock camera ...would it change the folder that my camera saves the pictures it takes???..or will it stay as normal
it will only change if i had the HTC camera right?
Click to expand...
Click to collapse
The folder that your camera saves the pictures to is determined ONLY by your camera. This Gallery3D was modified to enable HTC Camera users to have the same benefits as stock camera users - having their default camera album sorted in reverse.
vk2bea said:
When a new picture is taken it appears with the wrong name and no geo tag (as you noted in the post in Enomthers' thread). I've restarted the gallery3D but this doesn't correct the issue. It only seems to be corrected with a reboot.
Is there something short of a reboot I can do to see the correct name / tag ?
Click to expand...
Click to collapse
This is most probably HTC Camera incompatibility that needs to be addressed. I suppose (I'm not sure - since I don't know how it works, Enomther or Cyanogen team would be the right people to know for sure) that intent is passed from Camera to Gallery (since the Gallery refreshes the new photo - if you just try to copy the photo to SD card by ADB, it won't "see" the photo until the media info is refreshed), but the Gallery doesn't read the information correctly (maybe because some information is passed incorrectly between HTC Camera and Gallery).
I'll try to assist Enomther in making HTC Camera and Gallery3D compatible.
helfone said:
screenie please? O
Click to expand...
Click to collapse
As noted by vk2bea, this is the regular Gallery3D with fixes/patches that show higher resolution images without degrading the resolution like stock Gallery3D (for details, see the thread that I've linked to), and HTC Camera users from various ROMs get their own version that sorts the photos in their default camera folder correctly.
antiochasylum said:
Ever since CM6 final (kangorama) my phone had not displayed any pictures in the gallery, it was useless pretty much this actually fixed my gallery and now everything is displayed. Thanks a million jack. Got a donation link??
Click to expand...
Click to collapse
I'm not much of a dev, so I didn't set up that kind of thing I'm glad you got your problems solved, most probably it's the thumbnail cache clearing process that helped you. I've experienced lots of weird behavior when I was trying to test the changes between stock and HTC cameras, but clearing thumbnail cache each time made these changes seamless.
can you post the source code?
also I have some folders with a .nomedia file but the gallery seems to ignore that... I don't know if it's this Gallery3D problem or a general problem coming from google.
DBBGBA said:
also I have some folders with a .nomedia file but the gallery seems to ignore that... I don't know if it's this Gallery3D problem or a general problem coming from google.
Click to expand...
Click to collapse
Gallery3D doesn't scan the media, it's coming from Media Provider.
Check that your .nomedia file is correct (I have 3 on my SD card and they work like they should), and try to unmount/remount the SD card, reboot and clear the thumbnail cache (installation of this Gallery3D does it).
Source for HTC Gallery fix:
/src/com/cooliris/media/LocalDataSource.java
Replace:
Code:
46 public static final String CAMERA_STRING = "Camera";
With:
Code:
46 public static final String CAMERA_STRING = "100MEDIA";
Source for the high res fix:
/src/com/cooliris/media/Utils.java
Replace:
Code:
287 roundedSize = (initialSize + 7) / 8 * 8;
288 }
289
290 return roundedSize;
With:
Code:
roundedSize = (initialSize + 7) ;
}
int vmHeapSizeMB = (int) Runtime.getRuntime().maxMemory()/1048576; // Get the VM heapsize in mBytes
int respatchQualityFactor = vmHeapSizeMB/12; // Double the quality for 24mB devices and quadruple it for 36mB devices
int result = roundedSize/respatchQualityFactor;
if(result<=1) return 1;
else return result;
As seen here, from the linked thread in Desire forum by Number22:
http://github.com/mrPjer/android_pa.../blob/froyo/src/com/cooliris/media/Utils.java
Does it mean no more color banding with gallery3D?
vegetaleb said:
Does it mean no more color banding with gallery3D?
Click to expand...
Click to collapse
Unfortunately, I believe that banding will still be present. The patch doesn't change the color depth (which is the reason for banding), only the amount of memory reserved for image processing (and its quality as a result).
How do you clear just the thumbnail cache?
antiochasylum said:
How do you clear just the thumbnail cache?
Click to expand...
Click to collapse
rm -rf /sdcard/Android/data/com.cooliris.media/cache
should do it
Rodrigo didn't mention if his MIUI ROM included this, so I copied over the stock version and it works fine. thanks.
Hi Guys,
any chance of incorporating this sort order fix (thank god someone finally figured this out) into a new apk of the app?
I have suggested it on the other thread to:
http://forum.xda-developers.com/showthread.php?t=653503&highlight=gallery&page=14
What you think?

[Q] glReadPixels() Problem in Android to reconstruct the frame

I am working on a project on Augmented Reality with Android. The code captures the camera video, finds the marker and displays a cube on top of it. After this a motion vector (in the form of pixels moved in the x and y direction) is found. What I need to do is read the pixels from the GL layer and draw them again after moving them by the distance specified by the motion vector.
The GL layer is specified using the GLSurfaceView class which is a transparent layer. The problem I am facing is that when I use glReadPixels() to read the pixels and convert it into a 480x800 array (nexus one screen resolution), I get 3 different portions of the cube instead of one.
I intend to move the pixels by the motion vector after this and use glDrawPixels() to put the pixels back into the frame buffer
Please help me with the interpretation of the same. Is there something I am missing while using glReadPixels and also if there is some other function that will help me achieve the same. I was thinking of using glBlitFrameBuffer() but this is not supported by the android GL10 class.
I have attached the part of the code where I am reading the pixels and changing them to a 2D matrix along with the image of the pixels I reconstructed using MatLab.
Any help will be greatly appreciated.
Code:
gl.glPixelStorei(GL10.GL_PACK_ALIGNMENT, 1);
IntBuffer pixels = IntBuffer.allocate(384000);
gl.glReadPixels(0, 0, 800, 480, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE ,pixels);
File f = new File ("./mnt/sdcard/Sahiba_PixelData_" + flag + ".txt");
if(!f.exists())
f.createNewFile();
FileWriter fw = new FileWriter(f);
int pixelsArr [][] = new int [480][800];
//int temp[] = pixels.array();
int n=0;
for(int i=0; i<480; i++){
for(int j=0; j<800; j++){
pixelsArr[i][j] = pixels.get(n);
//temp[n + pixels.arrayOffset()];
fw.write(pixelsArr[i][j] + " ");
//fw.write(pixels.get(n) + " ");
n++;
}
//fw.write("\n");
}
Log.i("GLLayer", "Pixels reading and storing finished !!!");
}catch(Exception e){
Log.i("GLLayer","Exception = " +e);
}

Categories

Resources